Welcome Guest, Not a member yet? Register   Sign In
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




Theme © iAndrew 2016 - Forum software by © MyBB