|
Search:
Advanced search
|
Browse by category:
|
Contact Us |
Populating an array inside of a for loop using PHP |
|||||
Populating an array from inside a loop is very easy:
file: x.php //==================================================== <?php $i=10; for ($x=0;$x<=$i;$x++) { $testarray[]=$x; } foreach ($testarray as $value) { echo "$value<BR>"; } ?> //==================================================== #>php x.php 0 1 2 3 4 5 6 7 8 9 10 #> |
|||||
| Others in this Category | |
| Nested Variable assignments within PHP - Calling a variable with a variable inside a FOR loop | |
| Multi-dimensional PHP Arrays | |
Powered by
KBPublisher (Knowledge base software)