>> Would that be fopen()?  or something else?  I'm still new to PHP so any
>> feedback would be very appreciated.

> Use file_exists() to check whether a file exists.

file_exists() function is quite slow.
in your case, better do fopen() to check if the file exist,
because you gonna do fopen() anyway if the file exist.
if fopen() return error, then you can assume the file does not exist.
dont forget to add "@" in front of the function name, to surpress err
msg.

if ($f = @fopen($image)) {
  // file exist, read the content, then echo to browser
}
else {
  // file does not exist, open default image
}

--
Jimmy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bigamy is having one spouse too many.  Monogamy is the same.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to