lanana Posted June 25, 2013 Share Posted June 25, 2013 Hi I'm trying to make an array contains the a-z follow by a number in 8 digits but it has to be repeatedbefore the 4 digit.something like this, a00010001 a00020002a00030003a00040004a00050005to a10001000and when it ends go to the next caracterb00010001b00020002to b10001000hope can you give me an idea, Thanks !! Quote Link to comment https://forums.phpfreaks.com/topic/279572-array/ Share on other sites More sharing options...
dalecosp Posted June 25, 2013 Share Posted June 25, 2013 (edited) $myArray = array(); foreach (range("a","z") as $letter) { $x=1; while ($x<1001) { $myArray[] = $letter.str_pad($x,4,"0",STR_PAD_LEFT).str_pad($x,4,"0",STR_PAD_LEFT); $x++; } } Edited June 25, 2013 by dalecosp Quote Link to comment https://forums.phpfreaks.com/topic/279572-array/#findComment-1437869 Share on other sites More sharing options...
lanana Posted June 28, 2013 Author Share Posted June 28, 2013 thank you!!! that's really work , greetings Quote Link to comment https://forums.phpfreaks.com/topic/279572-array/#findComment-1438433 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.