PHP Tutorial

Define PHP

PHP Installation

PHP INI File

PHP Comment

PHP Case Sensitivity

PHP Variable, DataType

PHP Echo & Print

PHP Operators

PHP Receiving Input

Decision Making - if...else

PHP Switch Case

PHP Loops

PHP Jumping Statement

PHP Image Gallery

PHP File Upload

PHP Arrays

PHP Date Functions

PHP String Functions

PHP Math Functions

PHP Functions

PHP Variable Scope

PHP Constant Variable

PHP Superglobals

PHP Form Validation

PHP Include Statement

PHP Filter

PHP File Handling

PHP Cookies

PHP Session

PHP Send Emails

PHP Captcha

PHP MySQL Select

PHP MySQL Insert

PHP MySQL Delete

PHP MySQL Update

PHP MySQL Injection

PHP Assignment

Page Stats

Visitor: 341

PHP Image Gallery

Display all Images from a folder in php using for loop.

for($i=1;$i<=4;$i++)
{
    echo "<img src='image/$i.jpg' width='200px'>";
}

Count number of files from a folder.

$files = glob("image/*.jpg");
$filecount = count($files);
echo "There were $filecount files";

Display all images from a folder having any name.

$dir=opendir("image");
while($file=readdir($dir))
{
    echo "<img src='image/$file' width='200px'>";
}