I have an array, and I want to suffix "0" to the first 10 elements and "1" to the remaining array elements. So what I did was:
First.[php]for($i=0; $i<count($set_name); $i++)
$set_name[$i] .= $i < 10 ? "0" : "1";[/php]Error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 16 bytes)
Second[php]foreach($set_name as $i=>$s_name)
$set_name[$i] .= $i < 10 ? "0" : "1";[/php]Error: Suffixing "0" to all the elements.
Third[php]foreach($set_name as $i=>$s_name)
$set_name[$i] = $i < 10 ? $s_name."0" : $s_name."1";[/php]Error: Suffixing "0" to all the elements.
Fourth.... can anyone tell?