📅  最后修改于: 2022-03-11 14:54:17.855000             🧑  作者: Mango
function endsWith($haystack,$needle,$case=true) {
//If its case specific
if($case){
return (strcmp(substr($haystack, strlen($haystack) - strlen($needle)),$needle)===0);
}
return (strcasecmp(substr($haystack, strlen($haystack) - strlen($needle)),$needle)===0);
}