The Little Guy Posted November 12, 2008 Share Posted November 12, 2008 I want to grab the key for a given value. $array = array( 'fruit1' => 'apple', 'fruit2' => 'orange', 'fruit3' => 'grape', 'fruit4' => 'apple'); If I want find the key fro orange, I need the value to return fruit2 how can I do that? Link to comment https://forums.phpfreaks.com/topic/132485-solved-array-get-key-of-a-value/ Share on other sites More sharing options...
Mark Baker Posted November 12, 2008 Share Posted November 12, 2008 By reading the array_search() page of the manual and acting upon it Link to comment https://forums.phpfreaks.com/topic/132485-solved-array-get-key-of-a-value/#findComment-688848 Share on other sites More sharing options...
The Little Guy Posted November 12, 2008 Author Share Posted November 12, 2008 Awesome Thanks! Link to comment https://forums.phpfreaks.com/topic/132485-solved-array-get-key-of-a-value/#findComment-688850 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.