Re: Heredocs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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!
----------------------------------------------------------

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux