• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Check if Image exists in folder

#1
[eluser]woracal[/eluser]
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.

#2
[eluser]Glen Swinfield[/eluser]
Code:
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.

#3
[eluser]woracal[/eluser]
Thanks! Duh... that was easier than I thought. Spent my time looking for CI functions! So s.tupid! Smile


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.