PHP For Loop

Syntax

for (init; condition; increment)
{
 code to be executed;
}

Init is the starting point.
If condition is true loop continues, if false it stops.
Increment is incrementing the counter.

PHP example

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

Output

1
2
3
4
5


Go Daddy


Related articles

Redirect www to non www with .htaccess RewriteRule

Redirect www to non www with .htaccess RewriteRule

05/12/2015

Redirect your websites visitors from www.domain.com to domain.com without www.

Email Validation

Email Validation

08/02/2013

Learn how to validate email on client side with HTML5, Javascript and on server side with PHP.

Generate Thumbnail on the Fly with PHP

Generate Thumbnail on the Fly with PHP

04/02/2013

In a previous artice I already showed you how to generate square thumbnails with PHP. Now I show you how to keep the original ratio of the image and how to control the alignment of the square image.


Leave a comment

We welcome any comment from you! Please keep in mind that comments are moderated and rel='nofollow' is in use. So, please do not use a domain as your name or a spammy keyword, or your comment will be deleted.

Name: *

E-mail: *

Message: *

Click on the lion *


Find us on Facebook

Tags

Get online with the world's Best - GoDaddy.com!

Back to Top