Topic: Count occurrences of target in array -- how?!
This one is driving me nuts. I have tried quite a few things -- all of them silly, it seems -- and googled umpteen dozen false trails. Here's the problem:
What I want to do is count the number of times a given string occurs in an array. I have the string as a variable ($myString), and the array could have n occurrences of it. (The string will always occur at least once.)
It seems so simple! I can't get it with "count", or "array_count_values", or intersections, or anything else I have tried! ![]()
If anyone can help me out with this, I would be most grateful!
Last edited by DjR (2008-11-29 14:18:07)