How to get all images from specific directory.Like $Dir = 'images/marriage/';
Result
<img src="img1.png">
<img src="img2.png">
<img src="img3.png">
<img src="img4.png">
<img src="img5.png">
How to get all images from specific directory.Like $Dir = 'images/marriage/';
Result
<img src="img1.png">
<img src="img2.png">
<img src="img3.png">
<img src="img4.png">
<img src="img5.png">
Try this code. Put the file containing the code in the directory that contains the "images" directory
<?php
$dir = "images/marriage/";
$files = scandir($dir);
Foreach($files as $filename){
echo "<img src='".$dir."$filename'><br/>";
}
?>