Here is the code
[PHP]$alphabet = array("a","b"," c");
$number_of_lett ers = 3; //initial amount of characters
foreach($alphab ets as $letter)
{
print $letter;
if ($number_of_let ters != 26)
{
//add another character to the $alphabet array
//AND increase the $number_of_lett ers by 1
}
}[/PHP]
Now here is the question :
The above code will only process the initial array values even thoug the array is being added to, ie it will print only a,b and c
Logically, it should carry on printing as the $aphabet array is being continiously chaged.
Any thoughts appreciated
[PHP]$alphabet = array("a","b"," c");
$number_of_lett ers = 3; //initial amount of characters
foreach($alphab ets as $letter)
{
print $letter;
if ($number_of_let ters != 26)
{
//add another character to the $alphabet array
//AND increase the $number_of_lett ers by 1
}
}[/PHP]
Now here is the question :
The above code will only process the initial array values even thoug the array is being added to, ie it will print only a,b and c
Logically, it should carry on printing as the $aphabet array is being continiously chaged.
Any thoughts appreciated
Comment