note 123224 added to function.array-flip
| From: | AhammarYassine@php.net | Date: | Thu, 11 Oct 2018 18:03:22 +0000 |
| Subject: | note 123224 added to function.array-flip | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-209427@lists.php.net to get a copy of this message | ||
<?php
$arr = array('one' => ['four' => 4], 'two' => '2',
'three' => '3');
var_dump($arr);
$arr2 = array_flip($arr);
var_dump($arr2);
?>
The above example will output:
array(3) {
["one"]=>
array(1) {
["four"]=>
int(4)
}
["two"]=>
string(1) "2"
["three"]=>
string(1) "3"
}
Warning: array_flip(): Can only flip STRING and INTEGER values! in /root/test.php on line 4
array(2) {
[2]=>
string(3) "two"
[3]=>
string(5) "three"
}
----
Server IP: 208.43.231.9
Probable Submitter: 197.230.101.250
----
Manual Page -- http://php.net/manual/en/function.array-flip.php
Edit -- https://master.php.net/note/edit/123224
Del: integrated -- https://master.php.net/note/delete/123224/integrated
Del: useless -- https://master.php.net/note/delete/123224/useless
Del: bad code -- https://master.php.net/note/delete/123224/bad+code
Del: spam -- https://master.php.net/note/delete/123224/spam
Del: non-english -- https://master.php.net/note/delete/123224/non-english
Del: in docs -- https://master.php.net/note/delete/123224/in+docs
Del: other reasons-- https://master.php.net/note/delete/123224
Reject -- https://master.php.net/note/reject/123224
Search -- https://master.php.net/manage/user-notes.php