Hello every one I am facing problem in constructor .Even i know about this concept but using this key in calling function construction . Please suggest some coding example .
What problem are you having exactly? <?php class mytest { # The constructor .... function __construct() { $this->test = "hello"; } public function output() { print $this->test . "\n"; } } $test = new mytest; $test->output(); ?> PHP: You might also want to read up on constructors and destructors on the PHP site; http://php.net/manual/en/language.oop5.decon.php
do you mean calling the constructor function? it is automatically called after instantiating an object