Your using $array1[] in the forloop AND asssigning it new values, not a wise choice, this makes it very confusing.
This is how I do it, should work...
$count = $array1;
foreach($count as $pos => $val)
{
$array1[$pos] = "Hi number #$val";
$array2[$pos] = "Good luck number $val";
echo "$array1[$pos] \n $array2[$pos] \n";
}
You can find more about "foreach" here
www.php.net/manual/control-structures.foreach.php
foreach is another possibly better then for(;😉 in some cases.
if $array1[] looked like this.
$array1[0] = '';
$array1[1] = '';
$array1[2] = '';
$array1[3] = '';
for ($c = 0; $c < count($array1); $c++)
would work. but if array1[] looked like.
$array1[0] = '';
$array1[2] = '';
$array1[3] = '';
then
for(;😉 wouldn't work so great.
Chris Lee