marcushjortsberg Posted April 8, 2011 Share Posted April 8, 2011 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) ); ?> Quote Link to comment https://forums.phpfreaks.com/topic/233070-for-in-array/ Share on other sites More sharing options...
betterphp Posted April 8, 2011 Share Posted April 8, 2011 I don't really understand the question here... You can add an element like this $shop[] = array(1, 2, 3); Quote Link to comment https://forums.phpfreaks.com/topic/233070-for-in-array/#findComment-1198767 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.