我試圖diff的兩個數組和PHP還是返回了以下錯誤:和array_diff()不無明顯原因
Catchable fatal error: Object of class Node could not be converted to string in D:\projetos\labs\dok\dev\application\models\dok.php on line 410
我陣列分別是:
array(2)
object(Node)#5 ...[7 attributes]
object(Node)#6 ...[7 attributes]
array(1)
object(Node)#5 ....[7 attributes]
我真的欣賞一些幫助,因爲我不知道發生了什麼。謝謝(:
的要求,圍繞DIFF代碼:
// is it a distant child?
$all_childs = $node->get_childs(true);
$distant_childs = array_diff($all_childs, $childs);
if(in_array($this, $distant_childs))
return 'distant-child';
這將有助於看到這個 – AlexC 2012-02-13 02:38:42