When writing PHP scripts, you often need to search a string for a particular chunk of text. For example, you might be writing a search engine to search through pages of content, or you might want to know if a URL or email address contains a certain domain name.
PHP gives you many useful functions for searching strings. In this article you look at:
strstr()for finding out whether some text is in a string
strrpos()for finding the position of some text in a string
substr_count()for finding out how many times some text appears in a string