|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-10-05 17:32 UTC] netmosfera at gmail dot com
Description:
------------
hi
if I have an undetermined number of array I can't use array_diff to get the differences
a function like: array_diff_array() would be really nice
<?php
$myarrays[] = array("a" => "green", "red", "blue", "red");
$myarrays[] = array("b" => "green", "yellow", "red");
// undetermined number of arrays
print_r(array_diff_array($myarrays));
?>
I think that the only way to do this now, is using eval!
thank you!
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 09:00:01 2025 UTC |
You can already do this using call_user_func_array: $diff = call_user_func_array('array_diff', $arrays);