Passing entity in a function parameter value
| From: | David Greenberg | Date: | Sun, 10 Dec 2000 05:04:34 +0000 |
| Subject: | Passing entity in a function parameter value | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-29557@lists.php.net to get a copy of this message | ||
Hi,
I recently upgraded from PHP3 to PHP4. One side-effect I have noticed
is that a lot of the code I use to display photos in my photo album is
now broken.
Specifically, I use a function to display a specific photo:
function display_photo
($photo_header,$photo_path,$photo_alt,$photo_caption,$copyright_year) {
print "<H3>$photo_header</H3>\n";
print "<IMG SRC=\"$photo_path\" ALT=\"$photo_alt\">\n";
print "<BR CLEAR=all>\n";
print "<FONT CLASS=PhotoCaptionFont>\n";
print "$photo_caption\n";
print "<BR>Copyright © $copyright_year, all rights reserved.\n";
print "Not for commercial use.\n</FONT>\n";
return;
}
Note that the variables $photo_header, et al, usually contain to
represent whitespaces, since most of the parameters passed have spaces
in them.
In PHP3, this function worked fine. But since the upgrade to PHP4, the
function "chops off" any information in variables after and including
the first it encounters.
Any ideas?
Kindly,
David
PS: you can download the source code for my site on the site itself:
http://www.david-greenberg.net/projects.php