2012-12-23 78 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

相关问题