RE: [PHP-DB] concatenating (was: RE: [PHP-DB] Retrieving/Displaying hyperlinked images with PHP)
| From: | César Aracena | Date: | Sun, 07 Jul 2002 19:51:44 +0000 |
| Subject: | RE: [PHP-DB] concatenating (was: RE: [PHP-DB] Retrieving/Displaying hyperlinked images with PHP) | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-20374@lists.php.net to get a copy of this message | ||
Well, the string concatenation can be used to force PHP read and print a
variable within a echoed or printed string. As far as I know, it should
be used to make PHP handle a function inside a string. i.e.
echo "your total is:". total_function();
In your example, you might use as well:
echo "<img src=\"../site/products/" . $prod_sku.gif . "\";
having the same results. Notice how the HTML part is always enclosed by
quotes. PHP server reads this as:
echo "<img src=\"../site/products/whatever.gif\";
Hope this works,
C.
> -----Original Message-----
> From: Jen Swofford [mailto:jen@littleduck.com]
> Sent: Sunday, July 07, 2002 2:31 PM
> To: php-db@lists.php.net
> Subject: [PHP-DB] concatenating (was: RE: [PHP-DB]
Retrieving/Displaying
> hyperlinked images with PHP)
>
> Can somebody explain to me the rule on concatenating? So far, I
haven't
> had
> to use those mysterious-looking dots. ;) My code goes like this:
>
> echo "<td><img src=\"../site/products/$prod_sku.gif\"
> border=0></td></tr>";
>
> Does it work because I'm lucky? Honestly I haven't been impressed
with
> the
> documentation I've found online.
>
> Jen Swofford
> jen@littleduck.com
>
> > [snip]
> > // Then show image and/or details
> > echo "<img src=/image_folder/".$row[product_image].">";
> > [snip]
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php