Professional Documents
Culture Documents
Practical No 2 (WBP) 06
Practical No 2 (WBP) 06
Roll no: 06
Batch: C1
Practical no: 5
Output:
class person
{
public $name;
public $age;
function person()
{
echo "This is constructor";
}
function __construct($n,$a)
{
$this->name=$n;
$this->age=$a;
}
function display()
{
echo "<br> $this->name $this->age";
}
}
$p=new person("Disha",19);
$p->display();
?>
</body>
</html>
<?php
Output: