Sorry guys, not being lazy, I know others have had the same error message solved but I still couldn’t figure it out so I had to ask.
I have 2 2d arrays each with a string and a corresponding int.
I’m trying to compare the strings in the first array to the strings in the second and if they are the same, i want to add the corresponding integers together.
I am getting the error – “Cannot use a scalar value as an array” on the 7th line
for($countOne=0; $countOne<10; $countOne++)
{
for($countTwo=0; $countTwo<10; $countTwo++)
{
if($blekko_Array['url'][$countOne]==$bing_Array['url'][$countTwo])
{
$blekko_Array['score']['$countOne'] = $blekko_Array['score']['$countOne'] + $bing_Array['score']['$countTwo'];
}
}
}
Anyone know what the problem is?
Thanks
This should do it:
For one thing, your code is hardwired to look through 10 items, so if your array has less than 10 entries, you’ll get errors on the missing ones.