Re: [PHP] putting variables in a variable

[email protected] (Yannick Warnier)
Newsgroups php.general
Message-ID <1209089448.23771.7.camel@localhost>
Le lundi 28 mars 2011 à 12:06 +0100, Hulf a écrit :
> Hi,
> 
> I am making and HTML email. I have 3 images to put in. Currently I have
> 
> $body .="
> <table>
>   <tr>
>     <td><img src=\"image1.jpg\"></td>
>   </tr>
> 
>   <tr>
>     <td></td>
>   </tr>
> </table>
> ";
> 
> 
> ideally I would like to have
> 
> $myimage1 = "image1.jpg";
> $myimage2 = "image2.jpg";
> $myimage3 = "image3.jpg";
> 
> 
> and put them into the HTML body variable. I have tried escaping them in 
> every way i can think of, dots and slashes and the rest. Any ideas?

The question is not very clear to me, but doesn't the following give
what you are trying to get?

$myimage1 = "image1.jpg";
$body .="
<table>
  <tr>
    <td><img src=\"$myimage1\"></td>
  </tr>

  <tr>
    <td></td>
  </tr>
</table>
";

Otherwise, could you explain your intentions in another way?

Yannick
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.