PHP stristr() Function


The stristr() function is used to search for the first occurrence of a given string .

Syntax
stristr(string,search,before_search)
Parameters
  • String - (Required) Specify the string to search.
  • search - (Required) Specify the string to search .if this parameter is a number then return ASCII value.
  • before_search - (optional) it is false because defalut value.if it is returns true part of the string before the first occurrence of the search parameter.
Example
<?php
    echo stristr("Hii Hello!","Hello");
?>

Output

Hello!

Prev Next