Or you can just escape out of PHP like so:

<?php
    $truth = true;
    $head = "brain bucket";
?>
This is a test of the emergency broadcasting system. If this had been
an actual emergency, you would have been instructed to
<?php echo $truth?" place your {$head} between your legs and\n":"";
?>
read from the chapters of Matthew, Mark, Luke and DUCK!!


--- Sparky Kopetzky <[EMAIL PROTECTED]> wrote:
> I did figure a way around heredoc last night. Here's the solution
> if anyone
> can use it:
> 
> <?php
>     $truth = true;
>     $head = "brain bucket";
> $message = <<<TEST
> This is a test of the emergency broadcasting system.
> If this had been an actual emergency, you would have
> been instructed to
> TEST;
> 
>     if ($truth)
>     {
>         $message .= " place your {$head} between your legs and\n";
>     }
> 
> $message .= <<<TEST
> read from the chapters of Matthew, Mark, Luke
> and DUCK!!
> TEST;
> 
>     print $message;
> ?>
> $message is actually works in heredoc just like any other string.
> Didn't
> expect that.
> Hope this helps someone else who is trying the same thing as I am.
> 
> Robin E. Kopetzky
> Black Mesa Computers/Internet Services
> www.blackmesa-isp.net
> 
> ----- Original Message -----
> From: "Jennifer Goodie" <[EMAIL PROTECTED]>
> To: "Sparky Kopetzky" <[EMAIL PROTECTED]>; "PHP General"
> <[EMAIL PROTECTED]>
> Sent: Thursday, June 05, 2003 16:47
> Subject: RE: [PHP] Heredoc question
> 
> 
> > > Can one use <?php ?> within the heredoc syntax or is there
> > > another way?? I'm trying to dynamically generate email from
> > > generic text but with obvious additions, like this:
> >
> > http://us4.php.net/types.string says that heredoc acts just like
> double
> > quoted, which would mean it expands variables, so I would try
> just
> throwing
> > them in there like this...
> >
> >
> >  $message = <<<my_message
> >  Name: {$lot->get_name()}
> >
> >  Lot {$lot->get_id()} has been approved. Here is the
> >  link to the lot:
> >  my_message;
> >
> >
> > There's an example of almost exactly like this on that page.
> >
> >
> >
> >
> >
> >
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


=====
Mark Weinstock
[EMAIL PROTECTED]
***************************************
You can't demand something as a "right" unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***************************************

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to