NEWS: Total Picture Views: 155282 | Total Article Views: 165602 | Top 5 Most Popular Article: 1. Am I Stuck Algorithm with Becker Robot | 2. PickUpThings with Becker Robot | 3. How to read a JSON and work with it | 4. Encrypted Data GUI (Download .Zip) | 5. Create Wall and Things with Becker

Arrays Example with For Loop PHP/MySQL


In this example I will be showing how to use arrays with a for loop.



//Creating the array
$arrays = array();

//Creating variable $x
$x = 0;

//Adding the value into the array $arrays
for($i = 0; $i<10;$i++){
    $arrays[$i] = ($x * $i);

//Printing the array
for($i = 0; $i<10;$i++){
    echo ($i+1) . ". " . $arrays[$i] . "<br>";

//Looking at the size of the array
echo "<br> Size of the array: " . sizeof($arrays);
Attachments: None

Tags: For loop Arrays Size Array Size

Total Views: 832

My name is Jean-Mathieu

I created this website so other people could enjoy finding useful stuff easier. If you have any question do not hesitate to contact me.

jean8mathieuCreated on 12/18/14


Disclosure: We are a website that needs compensation to operate like any other website on the internet.
We may receive consideration for our reviews but we are totally unbiased and do not accept paid reviews or fake reviews claiming to be something they are not.