function stringStartWith($str, $needle) {
return strpos($str, $needle) === 0;
}
如判斷"love china"是否以love開頭:
if stringStartWith("love china","love")){
// ok, yes
}
function stringStartWith($str, $needle) {
return strpos($str, $needle) === 0;
}
如判斷"love china"是否以love開頭:
if stringStartWith("love china","love")){
// ok, yes
}
相關文章:
最新文章