With this code:
if($foo['bar'] == $baz) {
$results[] = $foo;
}
I never reach the assignment $results[] = $foo; (with a certain value)
Now if I do (with this same, certain value):
strcmp(trim($foo['bar']), trim($baz));
I get a result of 0, indicating the strings are in fact equal. So... why in the world can't I reach $results[] = $foo;?
Shouldn't $foo['bar'] == $baz be true if a strcmp of the two equals 0? What am I missing?
By the way, it's only one particular comparison that fails. Other comparisons using the same if statement will work fine.
example:
when $foo['bar'] == 'meat' and $baz == 'meat' I get $results['meat']
but when $foo['bar'] == 'meat sauce' and $baz == 'meat sauce' I get $results[]