Michdd Posted July 31, 2009 Share Posted July 31, 2009 What's the easiest way to get the key of a multidimensional array. Like this: $arr = Array( 'number1' => Array('foobar', 'foobar2') ); What would be the easiest way to get 'number1' from either foobar or foobar2? Is it possible to get without running a full loop? Link to comment https://forums.phpfreaks.com/topic/168232-solved-getting-a-key/ Share on other sites More sharing options...
.josh Posted July 31, 2009 Share Posted July 31, 2009 array_keys edit: my bad, you said multi-dim. array_search go through the user notes several methods posted for that. Link to comment https://forums.phpfreaks.com/topic/168232-solved-getting-a-key/#findComment-887365 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.