Re: Heredocs

From: Date: Wed, 29 Aug 2007 20:46:56 +0000
Subject: Re: Heredocs
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-261511@lists.php.net to get a copy of this message
RodgerW escreveu:
Are heredocs supported by PHP 5.2.3 running in WinXP/Apache2.2.4 ? I prrint via heredocs and its not working. Print with single quotes and double quotes work.
        <p>
        <h6>string init method 3: heredocs</h6>
        <?php
            print <<< END
                Test
            END;               ?>
        </p>
-------------------------
An example: <?php /* zerof "HEREDOC, a here document (also called a here-document), is a way of specifying a string literal in shells such as Bash, Windows PowerShell and the Bourne Shell, as well as programming languages such as Perl, PHP, and Ruby. It preserves the line breaks and other whitespace (including indentation) in the text. Some languages allow variable interpolation or even code to be evaluated inside of the string". */ $est01 = <<<IDF In reprehenderit in voluptate ullamco laboris nisi eu fugiat nulla pariatur.<br />Cupidatat non proident, velit esse cillum dolore ut labore et dolore magna aliqua.<br />Lorem ipsum dolor sit amet, mollit anim id est laborum.<br />Ut enim ad minim veniam, excepteur sint occaecat sed do eiusmod tempor incididunt.<br /><br /> "Lorem Ipsum" IDF; echo $est01; ?> -- zerof http://www.educar.pro.br/ Apache - PHP - MySQL - Boolean Logics - Project Management ---------------------------------------------------------- Você deve, sempre, consultar uma segunda opinião! ---------------------------------------------------------- Deixe todos saberem se esta informação foi-lhe útil. ---------------------------------------------------------- You must hear, always, one second opinion! In all cases. ---------------------------------------------------------- Let the people know if this info was useful for you! ----------------------------------------------------------

« previous php.general (#261511) next »