Hi,
I have a problem with variable variables. i have used these to solve an earlier problem i had posted here.
basically, i have some if statements which set a variable, this variable is then used with a word to make up a new variable.
Here is an abbreviated versio of what I have:
if(
($status1 == "win") &&
($status2 == "win") &&
($status3 == "win") &&
($status4 == "win") &&
($status5 == "lose")
)
{
$a = 1;
$b = 2;
$c = 3;
$d = 4;
$false == $status5;
}
if(
($status1 == "win") &&
($status2 == "win") &&
($status3 == "win") &&
($status4 == "lose") &&
($status5 == "win")
)
{
$a = 1;
$b = 2;
$c = 3;
$d = 5;
$false == $status4;
}
if($a){
return $total = fourfold(${'odds'.$a}, ${'odds'.$a."a"},
${'odds'.$b}, ${'odds'.$b."a"}, ${'odds'.$c}, ${'odds'.$c."a"},
${'odds'.$d}, ${'odds'.$d."a"}, $stake, ${'rf'.$a}='', ${'rf'.$b}='',
${'rf'.$c}='', ${'rf'.$d}='', ${'deadheat'.$a}='', ${'deadheat'.$b}
='', ${'deadheat'.$c}='', ${'deadheat'.$d}='', ${'eachway'.$a}='',
${'eachway'.$b}='', ${'eachway'.$c}='', ${'eachway'.$d}='',
${'status'.$a}='', ${'status'.$b}='', ${'status'.$c}='',
${'status'.$d}='');
}
these variables seem to work ok --> ${'odds'.$a}, ${'odds'.$a."a"} etc and are being passed to the fourfold function. However, ${'status'.$b}='' etc dont seem to work. I tried echoing out their values and nothing was returned.
Any ideas?
Thanks,
Martin