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 php stack?
Echo is used to Display message on screen. Which is used with echo to not output the trailing newline?
Do you know what's the difference between __sleep and __wakeup?
What is the difference between for and foreach?
Is php a cms?
Write a program using while loop in php?
What is reference variable php?
What is the difference between runtime exception and compile time exception?
What is delimiter php?
What is the purpose of using php?
Tell me which function gives us the number of affected entries by a query?
How to call php function from javascript using ajax?
How can we access the data sent through the url with the post method?
Write a program to swap two numbers using php.
What is default session time and path in PHP. How to change it?