After hours of debugging, I have finally determine that for some reason on a particular web-server running my small script, two equal strings are apparently being interpreted as
Why don't you try using trim in your trim($data[0]); and compare it.