PHP - String String Searching

Introduction

PHP gives you several string functions that let you search for one string inside another:

FunctionDescription
strstr() returns whether the search text is within the string
strpos() and strrpos()return the index position of the first and last occurrence of the search text, respectively
substr_count() returns how many times the search text occurs within the string
strpbrk()searches a string for any of a list of characters

Related Topic