note 39080 added to function.array-pad
| From: | mwwaygooathotmaildotcom at rn2 dot php dot net | Date: | Fri, 16 Jan 2004 13:02:44 +0000 |
| Subject: | note 39080 added to function.array-pad | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-63674@lists.php.net to get a copy of this message | ||
little older, a little wiser.
ksort() will order the array back into its normal order again
so:
$myArr = array(2 => 'two', 4 => 'four');
$newArr = array_pad(array(), 6, 'FILLED');
$newArr =$myArr+$newArr;
ksort($newArr);
Will give :
Array ( [0] => FILLED [1] => FILLED [2] => two [3] => FILLED [4] => four [5] =>
FILLED )
----
Manual Page -- http://www.php.net/manual/en/function.array-pad.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39080
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39080&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39080&report=yes
Search -- http://master.php.net/manage/user-notes.php