substr_compare < PHP
The substr_compare function compares two strings from a specified start position upto a specified length.
$string1 = "geeks for geeks";
$string2 = "geeks";
$stringCompare = substr_compare($string1, $string2, 0, 4);
echo $stringCompare;
// 0