Jump to content

Arrgghh HELP ME


tarun

Recommended Posts

[code]if (preg_match( "/[.]gif$/i", $file ))
{
  echo "<img src='".$file."'>";
}
elseif (preg_match( "/[.]mp3$/i", $file ))
{
  echo "<embed src='".$file."'>";
}[/code]
Just as kind of an aside too, make sure you post something descriptive in the title of the thread. "Arrgghh HELP ME" isn't very descriptive, the moderators here do lock threads often that have titles like that. "Matching file extensions" would be better. Cheers!

http://regexlib.com/CheatSheet.aspx
http://regexlib.com/RETester.aspx
Link to comment
https://forums.phpfreaks.com/topic/29694-arrgghh-help-me/#findComment-136723
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.