apijson-php
apijson-php copied to clipboard
endsWith方法不存在
endsWith方法不存在
应该是 ThinkPHP 里的,你确定依赖了 ThinkPHP ?
可以不依赖 endwith可以自己写一个
------------------ 原始邮件 ------------------ 发件人: "TommyLemon"[email protected]; 发送时间: 2019年6月6日(星期四) 下午3:20 收件人: "qq547057827/apijson-php"[email protected]; 抄送: "Subscribed"[email protected]; 主题: Re: [qq547057827/apijson-php] endsWith方法不存在 (#2)
应该是 ThinkPHP 里的,你确定依赖了 ThinkPHP ?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
startsWith和endsWith方法提供
if(!function_exists('startsWith')){
function startsWith($haystack, $needle)
{
$length = strlen($needle);
return (substr($haystack, 0, $length) === $needle);
}
}
if(!function_exists('endsWith')){
function endsWith($haystack, $needle)
{
$length = strlen($needle);
return $length === 0 ||
(substr($haystack, -$length) === $needle);
}
}
@ulikestyle 非常感谢,如果把代码 提交 Pull Request,你也会被加入这个项目的 贡献者名单 哦. 具体步骤可以参考 https://www.zhihu.com/question/21682976/answer/79489643