Re: PHP Syntax Notation

From: Date: Tue, 27 Sep 2005 17:09:45 +0000
Subject: Re: PHP Syntax Notation
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-223292@lists.php.net to get a copy of this message
I'm trying to expand my understanding of PHP by looking at some pre-built code modules. I don't fully understand the syntax "$site->Run();" in the following code. Can someone offer a helpful explanation? <?php //define("PB_CRYPT_LINKS" , 1); define("_LIBPATH","./lib/"); require_once _LIBPATH . "site.php"; $site = new CSite("./site.xml",true); $site->Run(); ?>
The $site variable is an object, specifically an instance of the CSite class. Run() is a method (i.e., a function) defined within this class, so the statement $site->Run() executes that function. This is basic object oriented stuff which you may not have run across before. Hope that helps, larry

« previous php.general (#223292) next »