PHP for loops explained

preview_player
Показать описание
#PHP #course #tutorial

00:00:00 intro
00:00:20 increment
00:02:46 decrement
00:03:31 exercise
00:06:39 conclusion
Рекомендации по теме
Комментарии
Автор

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<form action="index.php" method="post">
<label>Enter a number to count to:</label>
<input type="text" name="counter">
<input type="submit" value="start">
</form>
</body>
</html>
<?php
// for loop = repeat some code a certain # of times

$counter = $_POST["counter"];

for($i = 1;$i <= $counter; $i++){
echo $i . "<br>";
}
?>

BroCodez
Автор

You are just awesome, I've been doing coding for years in many languages but always try to avoid loops or always get help with books for loops because it was so confusing to me specially FOR and I leanrt many times via videos and by teachers but it was same for me but bro, the way you just explain or taught, it engraved in my mind, you are the GEM....
Thank you so much, you just unlocked my skill

hatimalizia