call a function within the same class
| From: | kalinga | Date: | Thu, 06 Jan 2005 05:54:14 +0000 |
| Subject: | call a function within the same class | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-205711@lists.php.net to get a copy of this message | ||
Dear all,
I recently started PHP OOP and I'm bit confused about best and the most
efficient methods when 'declaring a class' and 'calling function',
could somebody
explain me with following sample code, it would be great..
thanks..
class classLdap{
$rslt = $_POST['rslt'];
function ldapConnect($rslt){
....
......
return $rslt;
}// end function ldapConnect
function ldapAdd($rslt){
// i want to call ldapConnect($rslt) here what is the best method.
$rslt = classLdap::ldapConnect($rslt);
//or
//(curently i'm doing this way, it's to lengthy)
$new_classLdap = new classLdap;
$rslt = $new_classLdap->ldapConnect($rslt);
//or
$rslt = $this->ldapConnect($rslt);
}// end function ldapAdd
}// end class
--
vk.