FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Using a heredoc in PHP as in Perl
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Using a heredoc in PHP as in Perl [message #171893 is a reply to message #171885] Thu, 20 January 2011 12:05 Go to previous messageGo to previous message
Captain Paralytic is currently offline  Captain Paralytic
Messages: 204
Registered: September 2010
Karma:
Senior Member
On Jan 20, 9:00 am, "P E Schoen" <p...@pstech-inc.com> wrote:
> I am going to be using PHP to perform an HTML purification before the user's
> input from a form is presented to a Perl script which saves the content and
> presents it in HTML format. I am totally new to PHP and I have just a basic
> working knowledge of Perl. In Perl, I use a heredoc which is done with a
> statement such as:
>
>     print <<"END";
>     My Text...
>     END
>
> I found several references such ashttp://en.wikipedia.org/wiki/Heredocto a
> similar means for PHP, but it did not work for me (parse error on line with
> the <<<):
>
>     echo <<<EOF
>     My Text...
>     EOF;
>
> I am actually using this to create HTML, and I found that it can be simply
> written in the PHP document outside the <?php and ?> tags. But I would also
> like to be able to use a heredoc to print to a file, and I don't know if
> that is possible in PHP. If so, I'd appreciate any ideas on how to do it.
> TIA.
>
> Paul

Either do it ALL in php or ALL in perl. Why mix the 2?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Placing an URL in email
Next Topic: HOW TO MAKE MONEY ONLINE? MOST RICH PEOPLE ACHIEVE FROM FOREX
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 10:14:04 GMT 2024

Total time taken to generate the page: 0.04175 seconds