Find Value Of Key In Associative Array
I recently stumbled upon the following issue – I had an associative array with key=>value type and I wanted to get the value of a specific key. I wasn’t able to find a suitable built-in PHP function, so I decided to write something of my own. Feel free to reuse it however you like.
Include this function anywhere in your PHP file:
Then you can use it by following this example:
This example should output ‘expensive’. I hope you find this useful.
source : http://ephp.info/get-by-key-associative-array