The PHP version you're using does not support the third parameter of strstrDocs http://php.net/manual/en/function.strstr.php, hence the error message. Your usage of the function requires PHP 5.3.0 or higher.
您可以升级服务器上的 PHP 版本,也可以将函数调用替换为类似以下内容:
substr($v->post_title, 0, strpos($v->post_title, ":"))
或者如果您想使用更易于阅读的辅助函数(Demo http://codepad.org/5Ozpq6O6):
str_before($v->post_title, ":");
function str_before($subject, $needle)
{
$p = strpos($subject, $needle);
return substr($subject, 0, $p);
}
Related: strstr 显示出现之前的字符串 https://stackoverflow.com/questions/1521898/strstr-to-show-string-before-occurance