Hi, I want to get value from this array, I only need to get words which has value N. This is array: $myarray = array ( 'feeler gauge' => array ( 0 => 'h', ), 'feeler' => array ( 0 => 'N', ), 'feeless' => array ( 0 => 'A', ), 'feelingful' => array ( 0 => 'A', ), 'feelinglessly' => array ( 0 => 'v', ), 'feelingless' => array ( 0 => 'A', ), 'feelingly' => array ( 0 => 'v', ), 'feelingness' => array ( 0 => 'N', ), 'feeling' => array ( 0 => 'N', 1 => 'A', ), 'feel' => array ( 0 => 'V', 1 => 't', 2 => 'i', 3 => 'N', ), ); PHP: Lets say I want to get 'feeler' which is second array and first value which contains N value in its array. Let me know plz how can I get that value.
I did something like this, but I can`t get array key. As you see this array contains values and for each value array with key and values. So i need to match last value for each array and I did it but can`t extract value name: foreach ($myarray as $array) { $key = array_search('N', $array); echo $key; } PHP:
I'm going to give you a sample idea of how parsing arrays within arrays works: foreach($myarray as $key => $value) { // $key is now 'feeler' or 'feeless' or etc // $value is now the array for 'feeler' or 'feeless' or etc (the $key) foreach($value as $inside_key => $inside_value) { // $inside_key is now 0, 1, 2, 3, etc // $inside_value is now 'h', 'N', 'A', etc } } PHP: I'm sure you'll figure out the rest from here