I have two functions and each has a variable with a decimal point number inside it:
function comehere1($fap_value1)
{
$first=$fap_value1;
echo 'fap_value1_comehere= '.$first;
}
function comehere2($fpdc_value1)
{
$second=$fpdc_value1;
echo 'fpdc_value1_comehere= '.$second;
}
Now I want a third function, lets say calc(), in which I calculate the sum of the two variables $first and $second, from the two functions, and store in a variable called $final_sum. Like:
function calc()
{
$final_sum=calculate($first, $second, '+');
echo 'final_sum= '.$final_sum;
}
These all functions are in a view file in CakePHP 2.5.6 and I have tried defining them with global OR putting them in bootstrap OR configure::write and read OR return and etc, but nothing is letting them add up because they are 'undefined' outside of their respective functions.
Any help would be highly appreciated!