'Warning: Cannot use a scalar value as an array'? (solved)
Posted: Mon Oct 28, 2013 1:15 am
I'm not quite sure as to the reasons it's giving this error
It only complains about $goodnum[1] & [2] and $price[1] & [2]. But not $goods[1] & [2]??
I could have sworn I've used arrays like this in PHP before and it's been fine...
Can anyone help me out - I just need a short array since latter in the code I have a very short for loop do the same thing twice, but with two different sets of data. Thanks!
Code: Select all
$goods[1]="";
$goods[2]="";
$goodnum[1]=0;
$goodnum[2]=0;
$price[1]=0;
$price[2]=0;I could have sworn I've used arrays like this in PHP before and it's been fine...
Can anyone help me out - I just need a short array since latter in the code I have a very short for loop do the same thing twice, but with two different sets of data. Thanks!