note 93596 added to control-structures.foreach
| From: | hueen at osu1 dot php dot net | Date: | Thu, 17 Sep 2009 17:33:52 +0000 |
| Subject: | note 93596 added to control-structures.foreach | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-160800@lists.php.net to get a copy of this message | ||
Re previous post: Unless I missed something, doesn't this achieve the same thing?:
<?php
$deviations = array(
3 => 'oranges',
5 => 'pears',
);
$standards = array_fill(1, 9, 'apples');
$result = $deviations + $standards;
ksort($result); //sort by key
print_r($result);
// Output:
// Array
// (
// [1] => apples
// [2] => apples
// [3] => oranges
// [4] => apples
// [5] => pears
// [6] => apples
// [7] => apples
// [8] => apples
// [9] => apples
// )
?>
----
Server IP: 69.147.83.197
Probable Submitter: 90.10.149.113
----
Manual Page -- http://www.php.net/manual/en/control-structures.foreach.php
Edit -- https://master.php.net/note/edit/93596
Del: integrated -- https://master.php.net/note/delete/93596/integrated
Del: useless -- https://master.php.net/note/delete/93596/useless
Del: bad code -- https://master.php.net/note/delete/93596/bad+code
Del: spam -- https://master.php.net/note/delete/93596/spam
Del: non-english -- https://master.php.net/note/delete/93596/non-english
Del: in docs -- https://master.php.net/note/delete/93596/in+docs
Del: other reasons-- https://master.php.net/note/delete/93596
Reject -- https://master.php.net/note/reject/93596
Search -- https://master.php.net/manage/user-notes.php