operator not supported for strings. It happens JUST in one page [duplicate]

<>

This question already has an answer here:

Answers


$location is already a string on that page. This is why you properly initialize variables before you use them:

$temperature = $location = array();

foreach ($display as $key => $value){
    if ($key % 2 == 0){  
         $temperature[] = $value;
    } else {
         $location[] = $value;
    }
}

Even better, separate your variable scopes better so you don't get a name clash like that. Use functions and classes with their private variable scopes and don't put everything in the global scope.


Need Your Help

Determine max number of character in a field

mysql sql phpmyadmin

The field size of the MySQL daabase I'm working on have been determine quite arbitrary and I'd like to review them based on its current data. So I'd like to determine the maximum number of characte...

Product Identifiers Are Valid On One Phone But Not Another

iphone in-app-purchase storekit

I've begun testing the In App Purchase functionality of my phone. It works great on my phone, every product id I submit works fine and comes back as valid, but as soon as I tested it on my coworkers