EllisLab text mark
Advanced Search
     
Check if Image exists in folder
Posted: 10 July 2007 08:14 AM   [ Ignore ]
Joined: 2007-06-13
11 posts

I need to display several images in a page. Some thumbnails images may not exist so I need to display an alternate image instead. Basically, i need to check if an image exists and display an alternative if it does not. Any comments would help.

 Signature 

http://www.straightlineprofits.com
Living Online

 
Posted: 10 July 2007 09:07 AM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2006-02-06
117 posts
if(!file_exists($file)){
   
// display alternative
}else{
   
// display file

Hope this helps - there may be a CI alternative - but what’s the point when there’s a native php function.

 Signature 

My Blog, I work at Erskine Design

 
Posted: 10 July 2007 10:05 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2007-06-13
11 posts

Thanks! Duh… that was easier than I thought. Spent my time looking for CI functions! So s.tupid! smile

 Signature 

http://www.straightlineprofits.com
Living Online