calmchess Posted June 6, 2013 Share Posted June 6, 2013 How do I search an array by string value and return the number of times that string occurs in an array? Is there a handy PHP method I don't know about that does this. my google search only comes up with array_search does setting it to strict do what I want? Thanks for taking the time to read this. --calmchess Quote Link to comment https://forums.phpfreaks.com/topic/278847-searching-an-array/ Share on other sites More sharing options...
Solution Jessica Posted June 6, 2013 Solution Share Posted June 6, 2013 array_count_values Quote Link to comment https://forums.phpfreaks.com/topic/278847-searching-an-array/#findComment-1434460 Share on other sites More sharing options...
calmchess Posted June 6, 2013 Author Share Posted June 6, 2013 well that was unusual way of accomplishing a task but it worked .......added to the ole toolbox in my head Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/278847-searching-an-array/#findComment-1434464 Share on other sites More sharing options...
Jessica Posted June 6, 2013 Share Posted June 6, 2013 How is that unusual?? It's for exactly what you described. I personally can't believe you did any research and didn't find it. The PHP manual is your friend. Quote Link to comment https://forums.phpfreaks.com/topic/278847-searching-an-array/#findComment-1434466 Share on other sites More sharing options...
calmchess Posted June 6, 2013 Author Share Posted June 6, 2013 (edited) well i mean an unusual name to search for I would think a google search for PHP search array would have given me results. At any rate thanks. --calmchess Edited June 6, 2013 by calmchess Quote Link to comment https://forums.phpfreaks.com/topic/278847-searching-an-array/#findComment-1434526 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.