1 2 3
function starts_with($haystack, $needle) { return (substr($haystack, 0, strlen($needle)) == $needle); }
How about:
return (strpos($haystack, $needle) === 0) ; ?
Sign in to leave a comment.