Get list of Images from a Folder using PHP
November 12, 2017 Comments 0 208 Views

Get list of Images from a Folder using PHP

With PHP you can get list of all images available under any particular folder. You can use preg_grap function to check file extension and get list of file having required extension.

Below is the example where we tried to get list of images having extention jpg / jpeg / gif / png to be listed on new line.

Above code will execute and list all images in new line which are available under folder “/var/www/project/foldername” this way you can find any file having specific extensions from any required folder.

Previous Virtuemart 3 code to track order transaction in Google Analytic
Next Avoid things In Smarter PHP 7

About author

Rio
Rio 37 posts

Expert web developer working in PHP, Wordpress, Joomla, Magento, Javascript etc.

You might also like

Using Type Declarations in PHP 7

PHP is considered to be a weak typed language. Using type declarations in PHP 7 simply means specifying which type of variable is being set instead of allowing PHP to

Working With PHP & Databases

Working with PHP & Database require basic knowledge of below items : Database Connection Inserting Data Reading Data Updating Data Deleting Data Making Database Connection : Using PHP you can

Creating HTML Form with PHP Server Side Validation.

This article will explain how you can create a HTML Form and do server side validation for the form. So the form which will display will be plain HTML and

PHP function to sort array alphabetically or numerically in ascending or descending order.

In this article we will walk through with example on how the PHP array sort functions works to sort the arrays key and values in alphabetically/numerically or ascending/descending order. Sort

Working with PHP Array – Indexed, Associative & Multi-Dimensional

PHP Array are variables which can hold more than one value at a time. For example if you want to store 1000 numbers then instead of defining 1000 variables its easy

Difference between echo and print statements

In PHP there are two basic ways to get your output : echo and print statements. We will show the difference between echo and print statements with a working example.

Secure directory by allowing access to IP address & Deny all using htaccess

Your website may have folders which you want to keep secure access using URL. For example Admin area you want to keep secure to access using particular IP address and

Post data to third party site using PHP CURL

PHP supports CURL library which allows you to connect and communicate to many different types of servers with many different types of protocols and supports the http, https, ftp etc.

ZIP Files & Folder using Simple PHP Code

Using PHP you can Zip Files and Folders with a simple php code, which will provide you with the functionality to create zip automatically without manual efforts. Simple PHP code to