Soledad Posted July 11, 2011 Share Posted July 11, 2011 hello everybody if I have this : $st = 'the peace must cover all over the world'; and : $e= 'e'; how can i detect the number of frequency (or occurrence) of the letter 'e' ???I used stripos() , strpos(), strrchr() ...etc but it find first and last occurrence of a string and not number of the occurrence!!!!!!!!!!! Link to comment Share on other sites More sharing options...
thescientist Posted July 11, 2011 Share Posted July 11, 2011 have you looked at the entire list of available PHP string functions?http://php.net/manual/en/ref.strings.phpsubstr_count I reckon is what you're looking for. Link to comment Share on other sites More sharing options...
Soledad Posted July 11, 2011 Author Share Posted July 11, 2011 thanks so much that what I'm looking for .. Link to comment Share on other sites More sharing options...
jeffman Posted July 11, 2011 Share Posted July 11, 2011 Here's a tip:The online PHP manual is really remarkable documentation. One of its best features is the column on the left that lists all the functions that are related to the one you're reading about (because they apply to the same data type).Every time you read about a function is an opportunity to glance over there and get familiar with the kind of stuff that's available. You don't even have to consciously memorize the list. After a hundred lookups or so, parts of the list will just stick in your mind.But only if you get in the habit of looking. Link to comment Share on other sites More sharing options...
Soledad Posted July 11, 2011 Author Share Posted July 11, 2011 @Deirdre's DadI knew this php online documentation and I always forward when I work with php but when I despond I ask in forums and thank you my friend for all times you help me in .. Link to comment Share on other sites More sharing options...
brucemand Posted July 12, 2011 Share Posted July 12, 2011 Here's a tip:...But only if you get in the habit of looking.hear, hear !!thanks so much that what I'm looking for .. also have a look at preg_match(), it's a more powerful method i think.i actually discovered that first before strpos() and it's more "advanced", but strpos() is what was more suited to my requirements, and the manual even told me so ! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.