Jump to content

help creating a multidimensional array


php_beginner_83

Recommended Posts

Hi All

 

I'm trying to create a multidimensional array using a while loop but it's not working.  When I try and print out the contents of the array, it's empty.

Does anyone have any ideas what I'm doing wrong???

 

Thanks in advance :)

 

$counter = 0;
$myarray = array();

while($counter <= 5)
{
    $myarray = array($counter, $counter + 1, $counter + 2);
    $counter ++;
}

Link to comment
https://forums.phpfreaks.com/topic/182891-help-creating-a-multidimensional-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.