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

What is a closure in php?

1031


Explain me what is x+ mode in fopen() used for?

1016


How to open a file in php?

1077


How do I get csrf token?

968


Do you know is it possible to extend the execution time of a php script?

1049


What is the use of htmlentities in php?

983


How to create a session? How to remove data from a session?

992


How cookies are transported from servers to browsers?

977


What is difference between static and constant in php?

999


Why does sql injection happen?

999


What is the use of isset() in php?

1039


How would you determine the size of a file in php?

1048


How to store the uploaded file to the final location?

995


What is the content of /etc directory?

1010


Under what circumstance is it impossible to assign a default value to a parameter while declaring a function?

1140