Porl123 Posted July 29, 2008 Share Posted July 29, 2008 Are there any functions that can verify an image link to make sure it's the right format? Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/117161-verifying-image-links/ Share on other sites More sharing options...
JonnoTheDev Posted July 29, 2008 Share Posted July 29, 2008 When you say format im guessing that you mean checking the file type i.e. jpg, gif For this: // image.jpg would display jpg $fileType = substr($filename,strpos($filename, ".")+1); print $fileType; You may also want to check if the file exists if(file_exists($pathToFile)) { // ok file exists } Quote Link to comment https://forums.phpfreaks.com/topic/117161-verifying-image-links/#findComment-602583 Share on other sites More sharing options...
Porl123 Posted July 29, 2008 Author Share Posted July 29, 2008 Thanks man! works completely Quote Link to comment https://forums.phpfreaks.com/topic/117161-verifying-image-links/#findComment-602594 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.