PHP function call of a another class within another class
################################
PHP CODE
################################
// function call of a another class
class class1
{
function function1()
{
return 123;
}
function function2()
{
return 259;
}
}
class class2
{
function function1()
{
$object = new class1();
echo $object->function1()+$object->function2();
}
}
$obj = new class2();
$obj->function1();
// function call of a another class
echo "<hr/>";
echo "Above Exapmle Basic : " . (123+259);
echo "<hr/>";
?>
################################
Output of the CODE
################################
382Above Example Basic : 382
Comments
Post a Comment