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
How many types of inheritances used in php and how we achieve it.
What is difference between print_r and echo in php?
Tell me will a comparison of an integer 12 and a string "13" work in php?
How do you create an array in php?
How to set cookies in PHP?
Is laravel an oop?
So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()?
How would you declare a function that receives one parameter name hello?
What are the string functions in php?
What are the steps involved to run php?
What are the methods of array in java?
How do I repair phpmyadmin?
What beforeFilter() is used?
What is the use of the function 'imagetypes()'?
What is the basic function to search files for lines (or other units of text) that contain a pattern.