Skip to content

Instantly share code, notes, and snippets.

@phpfiddle
Created August 26, 2013 19:56
Show Gist options
  • Save phpfiddle/6345899 to your computer and use it in GitHub Desktop.
Save phpfiddle/6345899 to your computer and use it in GitHub Desktop.
loops program
<?php
echo "<p>\n";
$counter=1;
while($counter < 10)
{
echo "abc ";
$counter++;
}
echo"</p>\n";
echo"<p>\n";
$counter=1;
do{
echo"xyz ";
$counter++;
}while($counter<10);
echo"</p>\n";
echo"<p>\n";
for($counter=1;$counter<10;$counter++)
{echo"$counter ";
}
echo"\n<ol>";
for($x='A';$x<'G';$x++)
{echo"<li>Item $x</li>\n";
}
echo"\n</ol>";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment