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? Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/168232-solved-getting-a-key/#findComment-887365 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.