A question - ($file_exists)
| From: | Matthew Cothier | Date: | Tue, 27 Mar 2001 18:30:12 +0000 |
| Subject: | A question - ($file_exists) | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-7898@lists.php.net to get a copy of this message | ||
I am setting up an episode guide for one of my favourite shows and with this I need to include three screenshots:
episodeID_a.jpg
episodeID_b.jpg
episodeID_c.jpg
In some cases though the files will not exist and therefore I need too check if they exist and if they don't then it will display a blank image...
Whats wrong with this code?
-------------------------------------------------
<?php
$img1 = "episodeID_a.jpg";
$img2 = "episodeID_b.jpg";
$img3 = "episodeID_c.jpg";
for ($x=1; $x <= 3; $x++) {
if (!$file_exists(.//$img$x)) {
//Change the variable $img? and give it the value of a temporary, blank image
$img$x="blank.jpg";
}
print("$img$x<br>");
}
?>
------------------------------------------------
I would be grateful for any help with this, thanks in advance,
Matt
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.