$codigo = 0;
while ($codigo <3){
echo ("codigo " . $codigo);
echo ("
");
$codigo = $codigo +1;
}
?>
$codigo = 0;
do {
echo ($codigo);
echo ("
");
$codigo = $codigo + 1;
}while ($codigo < 3)
?>
for ($i = 0; $i<=10; $i++){
echo($i);
echo ("
");
}
?>
$arr = array ("um", "dois", "tres");
foreach ($arr as $value){
echo ("valor: $value ");
echo("
");
}
?>
$arr = array (1,2,3,4,5,6);
$i = 0;
foreach ( $arr as $value){
echo ("valor: $values e seu indice : $i
");
$i = $i +1;
}
?>