PHP tutorial, we will show you how to check string in php variable using php language. This easy very easy using php language. we given code snippet.
Use can use the strpos function for string to search in
<?php $mystring = 'abc xyz'; $findme = 'abc'; $check_string = strpos($mystring, $findme); // because the position of 'a' was the 0th (first) character. if ($check_string === false) { echo "The string '$findme' was not found in the string '$mystring'"; } else { echo "The string '$findme' was found in the string '$mystring'"; echo " and exists at position $pos"; } ?>