php get images on folder code example
Example 1: Extract images from a folder in php
<?php
function rasmname(){
$dirname = "./";
$images = glob($dirname."*.jpg");
foreach($images as $image) {
echo '<img src="'.$image.'" /><br />';
}
}
rasmname();
Example 2: display image in php from folder
<html>
<head>
<title>display image</title>
</head>
<body>
<p>Here in your form and text</p>
<?php
echo "<img src='image-name.png' >";
?>
</body>
</html>