note 99880 added to function.array-flip
| From: | h3x at osu1 dot php dot net | Date: | Sun, 12 Sep 2010 20:11:50 +0000 |
| Subject: | note 99880 added to function.array-flip | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-172498@lists.php.net to get a copy of this message | ||
this function can be used to remove null elements form an array:
<?php
$ar = array(null,'1','2',null,'3',null);
print_r($ar);
/*
result:
Array
(
[0] =>
[1] => 1
[2] => 2
[3] =>
[4] => 3
[5] =>
)
*/
print_r(array_flip(array_flip($ar)));
/*
result:
Array
(
[1] => 1
[2] => 2
[4] => 3
)
*/
?>
----
Server IP: 216.235.13.26
Probable Submitter: 173.35.233.56
----
Manual Page -- http://www.php.net/manual/en/function.array-flip.php
Edit -- https://master.php.net/note/edit/99880
Del: integrated -- https://master.php.net/note/delete/99880/integrated
Del: useless -- https://master.php.net/note/delete/99880/useless
Del: bad code -- https://master.php.net/note/delete/99880/bad+code
Del: spam -- https://master.php.net/note/delete/99880/spam
Del: non-english -- https://master.php.net/note/delete/99880/non-english
Del: in docs -- https://master.php.net/note/delete/99880/in+docs
Del: other reasons-- https://master.php.net/note/delete/99880
Reject -- https://master.php.net/note/reject/99880
Search -- https://master.php.net/manage/user-notes.php