-3
以下代碼有什麼問題?沒有笑臉功能它可以工作,並與$ tz =笑臉($ this-> text);沒有。未能插入一行
我試圖把顯示錯誤,但.. MHMM不通過將合適的函數調用工程.. 0錯誤
ini_set('display_errors',1);
error_reporting(E_ALL);
<?php
class ChatLine extends ChatBase
{
protected $text = '', $author = '', $gravatar = '';
public function save()
{
$tz = smiley($this->text);
DB::query("
INSERT INTO webchat_lines (author, gravatar, text)
VALUES (
'".DB::esc($this->author)."',
'".DB::esc($this->gravatar)."',
'".$tz."'
)");
// Returns the MySQLi object of the DB class
return DB::getMySQLiObject();
}
public function smiley($text)
{
$privatesmilies = array(
":)" => "smile1.gif",
";)" => "wink.gif"
);
reset($privatesmilies);
while (list($code, $url) = each($privatesmilies))
$text = str_replace($code, "<img src=http://127.0.0.1/chat/img/$url align=absmiddle/>", $text);
return $text;
}
}
?>
嘗試$ tz = $ this->笑臉($ this-> text); – ajacian81
非常感謝! :) –
這個蘋果有什麼問題沒人能看到?請解釋**爲什麼**不起作用。 – Bojangles