$colors = array( 'red', 'green' )
I want to create an array from above array as
$colors = array( 'red', 'red (2)', 'red (3)', 'red (4)','red (5)'
'green', 'green (2)', 'green (3)', 'green (4)', 'green (5)' );
i Want to know if this is possible. I have an array say
Moderator: General Moderators
-
finesofttechnologies
- Forum Newbie
- Posts: 8
- Joined: Wed Apr 02, 2014 3:32 am
- Location: New delhi
Re: i Want to know if this is possible. I have an array say
If you want literally "red (2)" and such, you'll need to code that yourself using a couple loops: one over $colors and another counting from 2 to however many times you want each color repeated. Append each thing to a new array and you're done.