PHP function call of a another class within another class

################################
PHP CODE
################################

<?php
// 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
################################
382
Above Example Basic : 382

Comments

Popular posts from this blog

Page Unload Show Notification to user

Function Oriented File Upload PHP

Upload File Using PHP - Example For Image