Learning PHP and I have a question.
How does one obtain an element from an array and determine if it is equal to a static value? I have a return set from a query statement (confirmed the array has all values).
I tried:
<? if($row["rowValue"] == 1) {
}
?>
I was expecting the value to be 1, but it’s returning null (as if I’m doing it wrong).
You’re pretty much there; something like this should confirm it for you:
If that’s still returning ‘No’ you could try viewing the whole of the
$rowarray by doing a var dump of the array like so:This will give you detailed output of how the array is built and you should be able to see if you are calling the correct element within the array.