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
What is a closure in php?
Explain me what is x+ mode in fopen() used for?
How to open a file in php?
How do I get csrf token?
Do you know is it possible to extend the execution time of a php script?
What is the use of htmlentities in php?
How to create a session? How to remove data from a session?
How cookies are transported from servers to browsers?
What is difference between static and constant in php?
Why does sql injection happen?
What is the use of isset() in php?
How would you determine the size of a file in php?
How to store the uploaded file to the final location?
What is the content of /etc directory?
Under what circumstance is it impossible to assign a default value to a parameter while declaring a function?