class Database
{
public static $_instance;
public static function getInstance()
{
if(!isset(self::$_instance))
self::$_instance = new Database(DB_SERVER, DB_USER,
DB_PASS, DB_NAME);
print_r(self::$_instance);
return self::$_instance;
}
}
can any one explain "self::$_instance = new
Database(DB_SERVER, DB_USER, DB_PASS, DB_NAME);" this line
Answer Posted / guest
self::$_instance = new
Database(DB_SERVER, DB_USER, DB_PASS, DB_NAME);
It represents object creation of the class 'Database'.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Which is used to maintain the value of a variable over different pages?
Write a program to get second highest number in an array using php?
Is php used anymore?
Explain what is the difference between mysql_fetch_array() and mysql_fetch_assoc()?
What are properties in php?
Is php free to use?
Tell me what does the initials of php stand for?
What is an operator in php?
For image work which library is used in php?
What are the popular frameworks in php?
What is php rest api?
What are different types of runtime errors in php?
How do you create an array in php?
What is var_dump function in php?
What are major variables in research?