call a function within the same class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux