public static function StringStartsWith($string, $search) { $ret = false; if (strlen($string) >= strlen($search)) { $ret = (substr($string, 0, strlen($search)) == $search); } return $ret; } public static function StringEndsWith($string, $search) { $string = strrev($string); $search = strrev($search); return Utils::StringStartsWith($string,$search); }
Hope it helps :)
No comments:
Post a Comment