You can determine particular string exist in an input string with the help of strpos function. strpos returns false if the string is not found. It provides 0 if found at the beginning of string. It finds the position of occurrence of string within another string.
if(strpos($filename, $match) !== false)
{
// $match is present in $filename
}
else
{
// $match is not present in $filename
}
Its syntax is given below
strpos(string,find,start)
Where string requires the string to search, find specifies the string to find and starts specifies the position form where to begin the search.
0 Comment(s)