Changing the Value of a Property from Within a Method
<html>
<head>
<title>Changing the Value of a Property from Within a Method</title>
</head>
<body>
<?php class first_class{
var $name="Joe"; function setName( $n ){
$this->name = $n;
} function sayHello(){
print "my name is $this->name<BR>";
}
}
$obj1 = new first_class();
$obj1->setName("new name");
$obj1->sayHello();