2012-12-23 82 views
0

即時得到這個錯誤在Linux服務器致命錯誤函數名稱必須是一個字符串24

Fatal error: Function name must be a string in /home/calaniz1/public_html/system/get_answers.php on line 24

function print_answers($dom){ 

$endl = "<br />"; 
$html = file_get_dom($dom); 
$s=2; 
$answer = array(); 
$answer_id = array(); 
$count_total = 0; 
$count_index = 0; 
$errflag = false; 
foreach ($html('.closed') as $div) { 
    foreach ($div('select') as $ab){  
     $id = $ab->name; 
     $count_total ++ ; 
     $count_index = $count_total -1 ; 
     $answer_id[$count_index] = $id; 
     $answer[$count_index] = $ab->onmouseover; 
    } 

但在我的電腦上我沒有得到任何錯誤...

+0

哪一行是第24行?也請比較php版本。你可以在常量'echo PHP_VERSION;'中找到它 - 檢查是否有差異。 – hakre

+0

我正在嘗試更新標記wiki。你的標籤ganon代表什麼? – SnareChops

回答

1

我猜file_get_dom()返回關閉/匿名函數,甚至是一個帶有array($object, $methodName)的數組。第一個是PHP5.3,第二個是PHP5.4。無論如何,或者你正在做一些完全錯誤的事情。

短暫研究後:http://simplehtmldom.sourceforge.net/$html應該是一個對象,你正在尋找的是$html->find('.closed')

錯誤的庫中,對於評論它是這個:http://code.google.com/p/ganon/ 壞了,當一切都使用相同的標識和無命名空間;)

+0

+1,這是'$ html-> find('。closed')'。 –

+0

即使即時通訊使用此庫? http://code.google.com/p/ganon/ –

+0

@CarlosArturoAlaniz在這種情況下,我的第一點似乎很有趣:您正在使用過時的PHP版本? – KingCrunch

相關問題