Jump to content

for in array?


Recommended Posts

I found this

 

<?php
$shop = array( array("rose", 1.25 , 15),
               array("daisy", 0.75 , 25),
               array("orchid", 1.15 , 7)
             );
?>

 

but I need the second levels arrays to be dynamic, how do I do that??

 

Like

 

<?php
$shop = array( array(1, 2 , 3),
               array(2, 2 , 3),
               array(3, 2 , 3),
               array(4, 2 , 3),
               ...,
               array(n, 2 , 3)
             );
?>

Link to comment
https://forums.phpfreaks.com/topic/233070-for-in-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.