Here is the array $item_meta_data
I am working on:
And here is the code I have:
$found = false;
foreach( $item_meta_data as $key => $meta ){
if( $meta['name'] == "Hardware" && $meta['display'] == "Free-Standing Hardware (max height = 14')" ) {
$found = true;
break;
}
}
The $meta['display'] == "Free-Standing Hardware (max height = 14')"
is unexpectedly failing...I used double quotes to wrap the value because there's a single quote in the value. I have also checked the value is string:
Can anyone point out if there's something wrong with the if
statement? Interestingly, everything works if array has a simpler value in $meta['display']
PS: I have also tried the triple === comparative $meta['display'] === "Free-Standing Hardware (max height = 14')"
with no effect