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 !! 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 $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++; } } 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 Link to comment https://forums.phpfreaks.com/topic/279572-array/#findComment-1438433 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.