Re: A question - ($file_exists)
| From: | Darryl Friesen | Date: | Tue, 27 Mar 2001 18:37:30 +0000 |
| Subject: | Re: A question - ($file_exists) | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-7899@lists.php.net to get a copy of this message | ||
> Whats wrong with this code?
>
> $img1 = "episodeID_a.jpg";
> $img2 = "episodeID_b.jpg";
> $img3 = "episodeID_c.jpg";
> $img$x="blank.jpg";
That doesn't what you expect. I think the syntax is the same as Perl:
$var = "$img$x"; # $var hold the _name_ of the variable
# you want to change
$$var = "blank.jpg"; # The $$ syntax is used to references the
# actual variable
See the section of the manual dealing with variables
(http://www.php.net/manual/en/language.variables.php)
- Darryl
----------------------------------------------------------------------
Darryl Friesen, B.Sc., Programmer/Analyst Darryl.Friesen@usask.ca
Education & Research Technology Services, http://gollum.usask.ca/
Department of Computing Services,
University of Saskatchewan
----------------------------------------------------------------------
"Go not to the Elves for counsel, for they will say both no and yes"