Hi,
I am working on a bet calculator and have got some help here regarding it before.
I wont go into details of the betting part of the problem just the PHP one.
Basically, I need to call a function from within another function and still return the value to the main PHP script.
function doublecalc($odds1, $odds1a)
{
if(($status1 == "win") && (($status2 == "void"))
{
//the call to the other function
$total = singlecalc($odds1, $odds1a, $stake, $rf1, deadheat1, $eachway1, $status1);
$unitstake = $stake;
}
else{
if(($status1 == "win") && ($status2 == "win"))
{
do the normal function code
}
return $total;
}
This is a function that will check the values passed and if 2 of the values passed are of a certain value control will go to the other function which will then carry out the calculations (singlecalc)
Any help with this is much appreciated.
Thanks,
Martin