..
Substr_count function returns the number of occurrences of one string within another string. The function substr_count admits 4 parameters:
$ Where = "mrwebmaster is the portal of the Italian webmaster"; $ What = "webmaster"; echo substr_count ($ where, $ what);produce as output 2.
echo substr_count ($ where, $ what, 3);In this case the output is 1 in 3 as specifying the starting character of the string $ where it is reduced (ebmaster is the portal of the Italian webmasters) and the string "webmaster" is to be found only once.
echo substr_count ($ where, $ what, 3, 20);In this case, the output will be 0 because the string was further reduced (ebmaster is the portal) and the string $ search is not found.
| |
Linux (Course)
Complete guide to open-source system. From 49 €. |
| |
MySQL (Course)
Management of open-source database. From 39 €. |
| |
PHP (Course)
Full course for creating dynamic Web sites. From 49 €. |