You are here: call a function within the same class « PHP « IT news, forums, messages
call a function within the same class

Posted by Kalinga on 01/06/05 07:54

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.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация