From 424ddabc5942575e58e856359ef5a1cd2be1cde5 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Mon, 26 Jul 2004 10:08:51 +0000 Subject: [PATCH] array_u?intersect_u?assoc (bug #29380) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@164325 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../array/functions/array-intersect-assoc.xml | 5 +- .../functions/array-intersect-uassoc.xml | 85 ++++++++++++++++++ .../functions/array-uintersect-assoc.xml | 85 ++++++++++++++++++ .../functions/array-uintersect-uassoc.xml | 87 +++++++++++++++++++ .../array/functions/array-uintersect.xml | 86 ++++++++++++++++++ 5 files changed, 347 insertions(+), 1 deletion(-) create mode 100644 reference/array/functions/array-intersect-uassoc.xml create mode 100644 reference/array/functions/array-uintersect-assoc.xml create mode 100644 reference/array/functions/array-uintersect-uassoc.xml create mode 100644 reference/array/functions/array-uintersect.xml diff --git a/reference/array/functions/array-intersect-assoc.xml b/reference/array/functions/array-intersect-assoc.xml index a234655910..bbc6f41213 100644 --- a/reference/array/functions/array-intersect-assoc.xml +++ b/reference/array/functions/array-intersect-assoc.xml @@ -1,5 +1,5 @@ - + array_intersect_assoc @@ -62,6 +62,9 @@ Array See also array_intersect, + array_uintersect_assoc, + array_intersect_uassoc, + array_uintersect_uassoc, array_diff and array_diff_assoc. diff --git a/reference/array/functions/array-intersect-uassoc.xml b/reference/array/functions/array-intersect-uassoc.xml new file mode 100644 index 0000000000..91cfd97aec --- /dev/null +++ b/reference/array/functions/array-intersect-uassoc.xml @@ -0,0 +1,85 @@ + + + + + array_intersect_uassoc + Computes the intersection of arrays with additional index check. The indexes are compared by using a callback functions. + + + Description + + arrayarray_intersect_uassoc + arrayarray1 + arrayarray2 + array ... + callbackkey_compare_func + + + array_intersect_uassoc returns an array + containing all the values of array1 + that are present in all the arguments. Note that the keys are used in + the comparison unlike in array_intersect. + The indexes are compared by using a callback functions. + + + + <function>array_intersect_uassoc</function> example + + "green", "b" => "brown", "c" => "blue", "red"); +$array2 = array("a" => "GREEN", "B" => "brown", "yellow", "red"); + +print_r(array_intersect_uassoc($array1, $array2, "strcasecmp")); +?> +]]> + + + Result will look like: + + + brown +) +]]> + + + + + For comparison is used the user supplied callback function. + It must return an integer less than, equal + to, or greater than zero if the first argument is considered to + be respectively less than, equal to, or greater than the + second. + + + See also array_intersect, + array_intersect_assoc, + array_uintersect_assoc and + array_uintersect_uassoc. + + + + + diff --git a/reference/array/functions/array-uintersect-assoc.xml b/reference/array/functions/array-uintersect-assoc.xml new file mode 100644 index 0000000000..f6dba66ad0 --- /dev/null +++ b/reference/array/functions/array-uintersect-assoc.xml @@ -0,0 +1,85 @@ + + + + + array_uintersect_assoc + Computes the intersection of arrays with additional index check. The data is compared by using a callback function. + + + Description + + arrayarray_uintersect_assoc + arrayarray1 + arrayarray2 + array ... + callbackdata_compare_func + + + array_uintersect_assoc returns an array + containing all the values of array1 + that are present in all the arguments. Note that the keys are used in + the comparison unlike in array_uintersect. + The data is compared by using a callback function. + + + + <function>array_uintersect_assoc</function> example + + "green", "b" => "brown", "c" => "blue", "red"); +$array2 = array("a" => "GREEN", "B" => "brown", "yellow", "red"); + +print_r(array_uintersect_assoc($array1, $array2, "strcasecmp")); +?> +]]> + + + Result will look like: + + + green +) +]]> + + + + + For comparison is used the user supplied callback function. + It must return an integer less than, equal + to, or greater than zero if the first argument is considered to + be respectively less than, equal to, or greater than the + second. + + + See also array_uintersect, + array_intersect_assoc, + array_intersect_uassoc and + array_uintersect_uassoc. + + + + + diff --git a/reference/array/functions/array-uintersect-uassoc.xml b/reference/array/functions/array-uintersect-uassoc.xml new file mode 100644 index 0000000000..04f17b36c6 --- /dev/null +++ b/reference/array/functions/array-uintersect-uassoc.xml @@ -0,0 +1,87 @@ + + + + + array_uintersect_uassoc + Computes the intersection of arrays with additional index check. Both the data and the indexes are compared by using a callback functions. + + + Description + + arrayarray_uintersect_uassoc + arrayarray1 + arrayarray2 + array ... + callbackdata_compare_func + callbackkey_compare_func + + + array_uintersect_uassoc returns an array + containing all the values of array1 + that are present in all the arguments. Note that the keys are used in + the comparison unlike in array_uintersect. + Both the data and the indexes are compared by using a callback functions. + + + + <function>array_uintersect_uassoc</function> example + + "green", "b" => "brown", "c" => "blue", "red"); +$array2 = array("a" => "GREEN", "B" => "brown", "yellow", "red"); + +print_r(array_uintersect_uassoc($array1, $array2, "strcasecmp", "strcasecmp")); +?> +]]> + + + Result will look like: + + + green + [b] => brown +) +]]> + + + + + For comparison is used the user supplied callback function. + It must return an integer less than, equal + to, or greater than zero if the first argument is considered to + be respectively less than, equal to, or greater than the + second. + + + See also array_uintersect, + array_intersect_assoc, + array_intersect_uassoc and + array_uintersect_assoc. + + + + + diff --git a/reference/array/functions/array-uintersect.xml b/reference/array/functions/array-uintersect.xml new file mode 100644 index 0000000000..a100950dcf --- /dev/null +++ b/reference/array/functions/array-uintersect.xml @@ -0,0 +1,86 @@ + + + + + array_uintersect + Computes the intersection of arrays. The data is compared by using a callback function. + + + Description + + arrayarray_uintersect + arrayarray1 + arrayarray2 + array ... + callbackdata_compare_func + + + array_uintersect returns an array + containing all the values of array1 + that are present in all the arguments. + The data is compared by using a callback function. + + + + <function>array_uintersect</function> example + + "green", "b" => "brown", "c" => "blue", "red"); +$array2 = array("a" => "GREEN", "B" => "brown", "yellow", "red"); + +print_r(array_uintersect($array1, $array2, "strcasecmp")); +?> +]]> + + + Result will look like: + + + green + [b] => brown + [0] => red +) +]]> + + + + + For comparison is used the user supplied callback function. + It must return an integer less than, equal + to, or greater than zero if the first argument is considered to + be respectively less than, equal to, or greater than the + second. + + + See also array_intersect, + array_uintersect_assoc, + array_intersect_uassoc and + array_uintersect_uassoc. + + + + +