Welcome Guest, Not a member yet? Register   Sign In
Problems with arrays
#9

[eluser]Perkin5[/eluser]
Now I've just tried this:

Code:
$actual_price;
foreach ($records as $item):
foreach ($price as $code){
$var1 = $code->cat;
$var2 = $item->price;
$var3 = $code->val;
if($var1 == $var2){
$actual_price = $var3;
}
}
...
endforeach;

and amazingly it works, so presumably CI didn't like me putting $code->cat etc inside an if statement.

Not sure I understand what has happened.


Messages In This Thread
Problems with arrays - by El Forum - 03-25-2012, 10:40 AM
Problems with arrays - by El Forum - 03-25-2012, 10:46 AM
Problems with arrays - by El Forum - 03-25-2012, 01:02 PM
Problems with arrays - by El Forum - 03-25-2012, 01:05 PM
Problems with arrays - by El Forum - 03-25-2012, 01:19 PM
Problems with arrays - by El Forum - 03-25-2012, 01:34 PM
Problems with arrays - by El Forum - 03-25-2012, 01:40 PM
Problems with arrays - by El Forum - 03-25-2012, 01:50 PM
Problems with arrays - by El Forum - 03-25-2012, 01:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB