Employers
Jobseekers
Recruiting Partners
Login
Join Hyring
Join Hyring
Lesson
Introduction
Install
Syntax
Comments
Variables
Variable Scope
Echo / Print
Data Types
Strings
String Functions
Concatenation
Numbers
Math
Constants
Operators
If...Else
Nested If
Switch
Loops
While
Do While
For
Foreach
Functions
Arrays
Indexed Arrays
Associative Arrays
Multidimensional Arrays
Array Functions
Superglobals
$_GET
$_POST
Form Handling
Form Validation
Date and Time
Include Files
File Handling
Open / Read
Create / Write
Upload
Cookies
Sessions
JSON
Exceptions
What is OOP
Classes & Objects
Constructor
Destructor
Access Modifiers
Inheritance
Interfaces
Traits
Static
Back to lesson
PHP Loops
Counting from 1 to 5
Counting down by twos
Walking an array by index
Run
Language:
PHP
Change Theme
Change orientation
<?php for ($i = 1; $i <= 5; $i++) { echo "Row $i\n"; } ?>
<?php for ($i = 1; $i <= 5; $i++) { echo "Row $i\n"; } ?>
Output
Click Run to execute this code.