Reply to Re: inclosed variable heredoc

Your name:

Reply:


Posted by Janwillem Borleffs on 12/19/06 22:25

hihibibihi@hotmail.com wrote:
> Trying to get $foo="YES" into $text, but NO appears instead. Any
> ideas?
>

The way you are doing it, $text has already been assigned a value before
you're setting the new value for $foo.

Turn it around and you will be fine:

$foo="NO";

if (TRUE) {
$foo="YES";
}

$text=<<<EO
The variable is named: $foo
EO;

print $text;


JW

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация