I just started learning php and I have to do something like this which I got it working but I just have a few questions I want to ask for alternate way of doing but eh first of all the br/ is suppose to be with <> but somehow if i do that the coding at the bottom will see it as a line break.
Anyways if questions are…
-
With the coding below the outcome will be 0-9 (without 5) but I have to set
$zero=-1if I put$zero=0then the outcome would be 1-9 (without 5) is there a way I don’t have to make $zero=-1 and still have the outcome of 0-9 (without 5)? -
I realized I have to put
$zero++before the if and continue statement if I put it at the end of the script afterecho "$zero" . "br/";the script won’t run as wanted. Is this how it is suppose to be or I just don’t know the other way of doing it.
Thanks in advance for people replying ^_^
$squared = pow(3,2);
echo "\"3 squared is $squared:";
echo "br/";
$zero = -1;
while ($squared > $zero)
{
$zero++;
if ($zero == 5)
{
continue;
}
else if ($squared == $zero)
{
echo "$squared\"";
}
else
{
echo "$zero" . "br/";
}
}
Here it is (you were almost there 😛 )
PS: You’re welcome @clement