我在以下代码行中发生错误“致命错误:只能通过引用传递变量”。错误:PHP脚本中只能通过引用传递变量
$ag = array(M($forge[2][$i], NULL, TRUE), M($about[0]["text"], "Less", TRUE), M($address[0]["text"], NULL, TRUE), M($phone[0]["text"], NULL, TRUE), M($website[0]["text"], "...", TRUE));
if(CAT)
array_push($ag, M($cat[1], NULL, TRUE));
$pf_args = str_replace("%s, ", "", PLACEHOLDER, 4 - count($_POST['ad']));
file_put_contents("files/" . FILENAME . ".sql", vsprintf($pf_args, $ag), FILE_APPEND);
该消息在最后一行显示错误。任何人都可以告诉我原因?
(编辑):M()被定义为:
function M($text, $str = NULL, $escape = FALSE) {
if (!empty($str))
$text = str_replace($str, "", $text);
$text = str_replace("(Edit)", "", $text);
$text = str_replace("More", "", $text);
$text = str_replace("Less", "", $text);
$text = str_replace("<br>", "\n", $text);
if ($escape)
return mysql_escape_string(trimText(html_entity_decode(strip_tags($text))));
else
return trimText(html_entity_decode(strip_tags($text)));
}
究竟在哪一行? “M”如何定义? – Gumbo 2012-04-01 08:06:02
@Gumbo:file_put_contents()和M()只做了很少的字符串替换。 – Shubham 2012-04-01 08:10:18
怎么样显示M代码 – SergeS 2012-04-01 08:16:34