NYCPHP Meetup

NYPHP.org

[nycphp-talk] heredoc string formatting question

Ken Robinson kenrbnsn at rbnsn.com
Thu Aug 10 17:25:54 EDT 2006


At 05:19 PM 8/10/2006, Cliff Hirsch wrote:
>I currently generate email bodies as follows:
>
>$body  = "Hi $name. Welcome message.".NEWLINE;
>$body .= NEWLINE;
>$body .= $somevariable;
>$body  .= NEWLINE;
>$body .= "More body";
>

What I have been doing lately is something like this:

$tmp = array();
$tmp[] = "Hi $name, Welcome message";
$tmp[] = $somevariable;
$tmp[] = "More body";
$body = implode(NEWLINE,$tmp);

Ken 




More information about the talk mailing list