A basic Class example

<?php
class Details
{
var $property1;
var $property2;

function display($name, $age)
{
print “Your name is : $name<br>”;
print “Your age is: $age<br>”;
}
}

$obj = &new Details;
$obj->name = ‘programmer’;
$obj->age = ’22’;
$obj->display($obj->name, $obj->age);

?>

LEAVE A REPLY

Please enter your comment!
Please enter your name here

*