PHP: Loop or no loop?

Posted by Joseph Robidoux on Stack Overflow See other posts from Stack Overflow or by Joseph Robidoux
Published on 2010-01-30T01:17:14Z Indexed on 2010/05/25 11:21 UTC
Read the original article Hit count: 465

Filed under:
|
|
|

In this situation, is it better to use a loop or not?

echo "0";
echo "1";
echo "2";
echo "3";
echo "4";
echo "5";
echo "6";
echo "7";
echo "8";
echo "9";
echo "10";
echo "11";
echo "12";
echo "13";

or

$number = 0;

while ($number != 13)
{
    echo $number;
    $number = $number + 1;
}

© Stack Overflow or respective owner

Related posts about php

Related posts about best-practices