I am working on sorting some text, I want to count how many times a certain word occurs.
the text part like
I have no idea, you got some idea, we will work out some idea, I have no idea, you got some idea, we will work out some idea, I have no idea,you got some idea, we will work out some idea
how can I use php to count how many times "idea" occurred, like word "idea" occurred 9 I am confused on count and length.
Could someone give an example please? many thanks
substr_countmentioning answers here. ) Otherwise consider usingstr_word_count- or its regex equivalents.