PHP Demo
PHP Code
Output
$search_term=$_POST["term"]; if( $search_term ){ $chkstring = 'Following is a stripos demo with jQuery $.post method to check whether source string contains the search term or not, without reloading the webpage'; $termpos = stripos($chkstring, $search_term); if ($termpos === false) { echo "The search term '$search_term' is not found!"; } else { echo "The search term '$search_term' found at: $termpos position! "; } }
The Markup and jQuery code
A demo of stripos with $.post
Enter a string:
Result: