So I came to a point where I need to check a value inside an array:
Array [
'oneName' => [
'val' => 'str',
'price' => 'int'
],
'twoName' => [
'val' => 'str',
'price' => 'int'
]
]
however, these oneName
, twoName
key names are dynamically created from another script. I need to check the value of twoName['price']
(for example) in an if statement which is fine. I came across this SO post regarding a similar topic: php - get numeric index of associative array but this is done by specifying the key name and returning the index value based on that. How can I access twoName via a numeric index without specifying the key name? Or am I asking the impossible?