note 79920 deleted from function.array-unique by cmb

From: Date: Mon, 12 Nov 2018 14:45:58 +0000
Subject: note 79920 deleted from function.array-unique by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-209678@lists.php.net to get a copy of this message
Note Submitter: php_array_unique [at] peterwarnock.com ---- To clarify the note above Example #1, the function appears to cast the elements to strings for comparison and then return the type of the first unique element encountered. <?php $input = array(0, 2, "2", 3, "9", 9); $result = array_unique($input); var_dump($result); ?> array(4) { [0]=> int(0) [1]=> int(2) [3]=> int(3) [4]=> string(1) "9" }

« previous php.notes (#209678) next »