如果可能,仅使用标准的PHP函数,例如substr()、strrpos()、strpos()等。
5条回答 默认 最新
dtd58256 2009-06-15 23:24关注First, find the last position:
$last = strrpos($haystack, $needle); if ($last === false) { return false; }From there, find the 2nd last:
$next_to_last = strrpos($haystack, $needle, $last - strlen($haystack) - 1);本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报