Hey here is what i want to do:
I have a folder "images" which contains images named like "MB_FM_Example.png".
I want to loop through the folder and echo the images. Something like that:
<?php
$files = scandir('images/');
if ($files !== false)
{
foreach(is_array($files) as $f) {
if ($f == '..' || $f == '.')
?>
<li><img src="<?php echo 'images/'.$f ?>" alt="<?php echo $f ?>" title="">
<?php
}
}
?>
I need the images to have an url depending on the name of the image. For example image "MB_FM_Example1.png" will get the url "Examplepage?v=FM"
How can i realize this with php?
Thanks guys
EDIT:
I need just a part of the filename like in my example "FM" and i want the images to get an url like <a href="examplepage?v=FM"> <img src="IMAGEPATH"> </a>