Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

php Accessing a Property from Within a Method

Sun Oct 26, 2008 11:33 pm

Code:

<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>




Post a reply
  Related Posts  to : php Accessing a Property from Within a Method
 Assign default property value     -  
 Usage of the CSS property !important     -  
 Show image using before property     -  
 Dynamically Setting and Accessing Variables     -  
 update an xml file with jaxb and accessing to its elements     -  
 Accessing files in remote server (unix/windows) using JSP     -  
 Accessing Global Variables with the global Statement     -  
 overriding method in php     -  
 Creating a Method in jsp     -  
 What is a native method     -  

Topic Tags

PHP OOP