Accessing a Property from Within a Method : Class Method : Class PHP Source Code


PHP Source Code » Class » Class Method »

 

Accessing a Property from Within a Method



<html>
<head>
<title>Accessing a Property from Within a Method</title>
<body>
<?php
class first_class{
    var $name="Joe";
    function sayHello(){
        print "my name is $this->name<BR>";
    }
}

$obj1 = new first_class();
$obj1->sayHello();

 ?>
</body>
</html>

           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Class
» Class Method