advanced code snippet search
william0760 on 09/24/11
String
09/24/11 01:36pm
startsWith, endsWith, Contains
function str_startsWith($haystack, $needle) { return strpos($haystack, $needle) === 0;} function str_endsWith($haystack, $needle){ return strrpos($haystack, $needle) === strlen($haystack)-strlen($needle);} function str_contains($haystack, $needle) { return strpos($haystack, $needle) !== false;}
Report this snippet Tweet
Comment:
You need to login to post a comment.