<?php
$A= array("A1"=>array("x"=>1,"b"=>2,"d"=>3,"s"=>8),
"A2"=>array("a"=>4,"b"=>3,"c"=>2,"d"=>1)
);
function callback($a, $b) { return $a + $b; }
$keys = array_keys(array_reduce($A, "callback", array()));
sort($keys);
echo '<pre>';
print_r($keys);
echo '</pre>';
What am I wrong here?Because I got message:
Fatal error: Unsupported operand types in …. in line
Cannot reproduce, I dont get an error, if I execute your code. But it seems, that you just want to get the unique keys.