Jump to content

[SOLVED] check gif names from swf


Dodekus

Recommended Posts

Hello.

 

I earlier got a code that makes a list of all swf files in a map. Now I want to do that the link to the swf file should be a image (gif).

 

Here is the source code in the browser that gets generated by the php code:

 

<a href='directory/game.swf'>game.swf</a><br>

 

What I want to do is this:

 

<a href='directory/game.swf'>[b]game.gif[/b]</a><br>

 

Here is the code I have now:

 

<?php

$directory = "directory";

$dh =@ opendir($directory);
if ($dh) {
    while ($file = readdir($dh)) {
        if ($file != "." && $file != "..") {
            $fileInfo = pathinfo("" . $directory . "" . DIRECTORY_SEPARATOR . $file);
            if ($fileInfo["extension"] === "swf") {
               echo "<a href='" . $directory . "/" . $file . "'>" . $file . "</a><br>";
            }
        }
    }
}
?>

Link to comment
https://forums.phpfreaks.com/topic/120051-solved-check-gif-names-from-swf/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.