I struggled with what, in my opinion, should be a very simple problem for a while and just can't solve the answer.
I have two arrays, and these arrays contain information about id, linklabel and url in the following format:
$pageids
--------
Array (
[0] => Array
( [id] => 1
[linklabel] => Home
[url] => home )
[1] => Array
( [id] => 2
[linklabel] => Graphic Design
[url] => graphicdesign )
[2] => Array
( [id] => 3
[linklabel] => Other Design
[url] => otherdesign )
[3] => Array
( [id] => 6
[linklabel] => Logo Design
[url] => logodesign )
[4] => Array
( [id] => 15
[linklabel] => Content Writing
[url] => contentwriting )
)
$parentpage
-----------
Array (
[0] => Array
( [id] => 2
[linklabel] => Graphic Design
[url] => graphicdesign )
[1] => Array
( [id] => 3
[linklabel] => Other Design
[url] => otherdesign ) )
Now I'm trying to compare these two to find the information located in $pageids, but NOT in $parentpage- then another array with the name will be created $pageWithNoChildren. However, when I use the following code:
$pageWithNoChildren = array_diff_assoc($pageids,$parentpage);
array_diff_assoc() , $pageids $parentpages [0] [1], $pageids [2] . , , . , , id, linklabel url $pageids, $parentpages .
array_diff_assoc() , , , [0], [3] [ 4] $pageids?