function stringStartWith($str, $needle) { return strpos($str, $needle) === 0; }
如判断"love china"是否以love开头:
if stringStartWith("love china","love")){ // ok, yes }
Copyright© 2013-2020
All Rights Reserved 京ICP备2023019179号-8