我如何编写两个带字符串的函数,如果它以指定的字符/字符串开头或以它结尾,则返回?
例如:
$str = '|apples}'; echo startsWith($str, '|'); //Returns true echo endsWith($str, '}'); //Returns true
php string
php ×1
string ×1