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 / 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 |
What is array filter in php?
Whether php supports microsoft sql server?
What is the best practice for running mysql queries in php? Consider the risk of sql injection.
How is session data stored?
Differentiate between php5 and php7?
What is the use of @ in php?
How many ways to include variables in double-quoted strings in php?
what is the url rewriting?how to rewrite the url? give any example
How is it possible to propagate a session id?
What is super () python?
What is a php array?
Tips to optimize the php script..... Suggestion for exception handling in php...