Re: echo "" problem NEW
| From: | Nicolas Costes | Date: | Wed, 09 Jan 2002 13:11:34 +0000 |
| Subject: | Re: echo "" problem NEW | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-79901@lists.php.net to get a copy of this message | ||
Hellorghh !!!
You'd better do like this :
echo "<table border='0' cellpadding='0' cellspacing='0'
width='639'>
Le Mercredi 9 Janvier 2002 13:05, Henning Sprang a écrit :
> Hy,
>
> universal2001 wrote:
> > Hi again!
> >
> > Thanks for the reply!
> >
> > I still have another question:
> >
> >
> > so I tired to use (echo) like this:
> >
> > echo "<table border="0" cellpadding="0"
> > cellspacing="0" width="639">
> > <tr>
> > <td><img src="img_heading/spacer.gif" width="25"
> > height="1"
> > border="0"></td>
> > </tr>
> > <tr>
> > <td colspan="11"><img name="index_r1_c1"
> > src="img_heading/index_r1_c1.gif" width="639" height="5"
> > border="0"></td>
> > <td><img src="img_heading/spacer.gif" width="1"
> > height="5"
> > border="0"></td>
> > </tr>
> > <tr>
> > <td rowspan="5"><img name="index_r2_c1"
> > src="img_heading/index_r2_c1.gif" width="25" height="43"
> > border="0"></td>
> > </table>";
> > but it DOES NOT WORK.
> > How do I get way with all of the quotation marks????
>
> 1) you can escape each double quote with a backslash,
> the first line of your thing woulkd then look like
>
> echo "<table border=\"0\" cellpadding=\"0\"
> cellspacing=\"0\"
> width=\"639\">
>
> and so on
>
> 2) if you don't want this by any reason, you can use single quotes to
> mark the text you want to print out like in
>
> echo '<table width="100%">';
>
> the difference is that with single quotes you will _not_ be able to use
> variable replacement in between the quotes, something like
>
> <?
> $myvar=100;
> echo "<table width=\"$myvar\">";
> ?>
>
> will output
>
> <table width="100%">
>
>
> while this:
>
> <?
> $myvar=100;
> echo '<table width="$myvar">';
> ?>
>
> will output exactly
>
> <table width="$myvar">
>
>
> hth,
> henning
--
( * > Nicolas Costes,
//\\ IUT de La Roche / Yon
( \/ ) Nayco@laroche.univ-nantes.fr
< < http://luxregina.free.fr