0

I have the following comparison:

if($panoraComparacion['center']==$updatedPanorama['center']){
        //Do stuff
}

Now the values of the 'center' array are as follows:

$panoramaComparacion['center']
latitude = -33.83306935448361
longitude = 150.435259765625

$updatedPanorama['center']
latitude = -33.83306935448361
longitude = 150.435259765625

They are the same, however the comparison is returning always false... Why is this? In php the == will return true if all of the index and values of the array are the same right?. I'm sorry if this is a silly question, but I'm starting to learn php. Thanks a lot.

4

1 に答える 1

4

$panoraComparacion、 本当..?$panoramaComparacion代わりに試してください:

var_dump($panoramaComparacion['center'] == $updatedPanorama['center']); // true
于 2012-05-10T04:35:23.647 に答える