PHP: array_diff_uassoc - Manual in Deutsh
PHP: array_diff_uassoc - Manual in French
PHP: array_diff_uassoc - Manual in Polish

You Are At PHP: array_diff_uassoc - Manual Area


recent searches:
include functions , variable functions , post functions...




If you are new to PHP or just need to refresh your skills, this is the place to start. This series of tutorials will give you the basic knowledge you will need to create a simple PHP website.

PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.

PHP Manual
PrevNext

array_diff_uassoc

(PHP 5)

array_diff_uassoc -- Computes the difference of arrays with additional index check which is performed by a user supplied callback function

Description

array array_diff_uassoc ( array array1, array array2 [, array ..., callback key_compare_func] )

array_diff_uassoc() returns an array containing all the values from array1 that are not present in any of the other arguments. Note that the keys are used in the comparison unlike array_diff().

This comparison is done by a 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. This is unlike array_diff_assoc() where an internal function for comparing the indices is used.

Example 1. array_diff_uassoc() example

<?php
function key_compare_func($a, $b)
{
    if (
$a === $b) {
        return
0;
    }
    return (
$a > $b)? 1:-1;
}

$array1 = array("a" => "green", "b" => "brown", "c" => "blue", "red");
$array2 = array("a" => "green", "yellow", "red");
$result = array_diff_uassoc($array1, $array2, "key_compare_func");
print_r($result);
?>

The above example will output:

Array
(
    [b] => brown
    [c] => blue
    [0] => red
)

In our example above you see the "a" => "green" pair is present in both arrays and thus it is not in the ouput from the function. Unlike this, the pair 0 => "red" is in the ouput because in the second argument "red" has key which is 1.

The equality of 2 indices is checked by the user supplied callback function.

Note: Please note that this function only checks one dimension of a n-dimensional array. Of course you can check deeper dimensions by using, for example, array_diff_uassoc($array1[0], $array2[0], "key_compare_func");.

See also array_diff(), array_diff_assoc(), array_udiff(), array_udiff_assoc(), array_udiff_uassoc(), array_intersect(), array_intersect_assoc(), array_uintersect(), array_uintersect_assoc() and array_uintersect_uassoc().

Widowiskowa i skuteczna reklama zewnętrzna dla twojego biznesu
sale sale szkoleniowe szkolenia
skarbykibica
meble łazienkowe
Pomoc drogowa Rzeszów merc

Another Useful functions:


zend-macro.zend-arg-array-info | zend-api.zend-get-parameters-array | zend-api.zend-get-parameters-array-ex | zend-api.zend-copy-parameters-array | zend-api.init-op-array | zend-api.destroy-op-array | zend-api.array-init | ref.array | language.types.array | language.operators.array | function.udm-alloc-agent-array | function.sybase-fetch-array | function.sqlite-fetch-array | function.sqlite-array-query | function.sesam-field-array | function.sesam-fetch-array | function.pg-fetch-array | function.odbc-fetch-array | function.oci-fetch-array | function.oci-bind-array-by-name | function.mysqli-fetch-array | function.mysql-fetch-array | function.mssql-fetch-array | function.msql-fetch-array | function.msession-set-array | function.msession-get-array | function.maxdb-fetch-array | function.iterator-to-array | function.is-array | function.ingres-fetch-array | function.in-array | function.hw-objrec2array | function.hw-array2objrec | function.httpquerystring-toarray | function.filter-var-array | function.filter-input-array | function.fbsql-fetch-array | function.db2-fetch-array | function.curl-setopt-array | function.call-user-method-array | function.call-user-func-array | function.arrayobject-offsetunset | function.arrayobject-offsetset | function.arrayobject-offsetget | function.arrayobject-offsetexists | function.arrayobject-getiterator | function.arrayobject-count | function.arrayobject-construct | function.arrayobject-append | function.arrayiterator-valid | function.arrayiterator-seek | function.arrayiterator-rewind | function.arrayiterator-next | function.arrayiterator-key | function.arrayiterator-current | function.array | function.array-walk | function.array-walk-recursive | function.array-values | function.array-unshift | function.array-unique | function.array-uintersect | function.array-uintersect-uassoc | function.array-uintersect-assoc | function.array-udiff | function.array-udiff-uassoc | function.array-udiff-assoc | function.array-sum | function.array-splice | function.array-slice | function.array-shift | function.array-search | function.array-reverse | function.array-reduce | function.array-rand | function.array-push | function.array-product | function.array-pop | function.array-pad | function.array-multisort | function.array-merge | function.array-merge-recursive | function.array-map | function.array-keys | function.array-key-exists | function.array-intersect | function.array-intersect-ukey | function.array-intersect-uassoc | function.array-intersect-key | function.array-intersect-assoc | function.array-flip | function.array-filter | function.array-fill | function.array-fill-keys | function.array-diff | function.array-diff-ukey | function.array-diff-uassoc | function.array-diff-key | function.array-diff-assoc | function.array-count-values | function.array-combine | function.array-chunk | function.array-change-key-case |


PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.