Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Explain me is multiple inheritance supported in php?

1107


What are access specifiers?

1063


What is laracast?

1073


What is the use of htmlentities in php?

1032


What are the special characters you need to escape in double-quoted stings?

1127


What is filter_var?

1072


What is singleton design pattern in php?

1040


What are the functions used in php?

1116


So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()?

1086


What is session php?

1006


How does php session work?

1028


What type of headers that PHP supports?

1062


What is url encoding and decoding in php?

1155


Which character is used to match exactly one character?

1050


Could we start a variable with number like $4name?

972