If you’re new to PHP, I would get into the habit of putting your code into brackets and using indentation:
[php]$Count = 0;
while ($Count > 100) {
$Numbers[] = $Count;
++$Count;
}
foreach ($Count as $CurNum) {
echo “
$CurNum
”;
}[/php]
Also, the $Count variable will never be over 100 (you’re using the greater than > operator). It should be less than:
[php]while ($Count < 100) {
$Numbers[] = $Count;
++$Count;
}[/php]
In the foreach, the argument before the as should be the array. You’re using the $Count variable (which is a number) - it should be the $Numbers array:
[php]foreach ($Numbers as $CurNum) {
echo “
$CurNum
”;
}[/php]
As well as this, you should define the array before you use it:
[php]$Numbers = array();[/php]
Giving you:
[php]$Numbers = array();
$Count = 0;
while ($Count < 100) {
$Numbers[] = $Count;
++$Count;
}
foreach ($Numbers as $CurNum) {
echo “
$CurNum
”;
}[/php]
This works as expected on codepad: http://codepad.org/kFFKVX7B