Tuesday, 20 March 2012

OBJECT

<html>
<head>
<title>Example:2</title>
</head>
<body>
<?php
class first_class
{
var $name="sateesh";
var $class ="M.Sc Computer Sci.";
}
$obj1 = new first_class();
$obj2 = new first_class();
$obj1->name ="bagadhi";
print "$obj1->name<BR>";
echo "$obj2->name<BR>";
echo "$obj2->class<BR>";
?>
</body>
</html>

OUTPUT
bagadhi
sateesh
M.Sc Computer Sci.

No comments:

Post a Comment