I have a php array like this:
array(
[0] =>
array(
... 3 elements ... )
['cat'] =>
'FF'
...
['iPath'] =>
'http://www.xx.com/images'
...
['dispName'] =>
'Fast Food'
...
)
[1] =>
array(
... 3 elements ... )
['cat'] =>
'G&L'
...
['iPath'] =>
'http://www.xx.com/images'
...
['dispName'] =>
'Grocery & Liquor'
...
)
[2] =>
array(
... 3 elements ... )
['cat'] =>
'Gas'
...
['iPath'] =>
'http://www.xx.com/images'
...
['dispName'] =>
'Gas Stations'
...
)
)
I want to be able to get the values for: iPath and dispName when cat = XXX. For instance, when cat = ‘G&L’.
thanks
ldj
A. I don’t understand anything from your example code.
B. To get array values in PHP you can use both numeric key values and string key values. Any of the following is valid:
Also note that
$arr[42]will address the same element as$arr['42'].C. Here’s some recommended reading: http://php.net/manual/en/language.types.array.php
A’. To find the keys for all the
Gasvalues in the array.