The <<< convension

From: Date: Wed, 17 Mar 2004 21:29:51 +0000
Subject: The <<< convension
Groups: php.general 
Request: Send a blank email to php-general+get-180755@lists.php.net to get a copy of this message
I have read a range of comments on php.net manual where people have mentioned this, along with it being in the 'print' functions page itself. I have tryed to use it in some context before but without success, I have always been getting an error on some sort. For example; <?php $text = <<<END This uses the "here document" syntax to output multiple lines with $variable interpolation. Note that the here document terminator must appear on a line with just a semicolon no extra whitespace! END; print $text; ?> I would get this error when running the above script. *Notice*: Undefined variable: variable in *C:\WWW\Apache2\htdocs\php\testprint.php* on line *4* This uses the "here document" syntax to output multiple lines with interpolation. Note that the here document terminator must appear on a line with just a semicolon no extra whitespace! I am a little confused at this point as I followed a comment on the manual which had not been corrected by anyone. I am running PHP 4.3.4 -- /* remember not to open virii please :) */ if (!gotbrain("receiver")) { openattachment("coolprogram.exe.jpg.pif"); }

« previous php.general (#180755) next »