php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #12535 We'd like support for output buffering and "here" syntax
Submitted: 2001-08-02 13:53 UTC Modified: 2001-08-02 14:16 UTC
From: matt at boltbluecorp dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.0.6 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: matt at boltbluecorp dot com
New email:
PHP Version: OS:

 

 [2001-08-02 13:53 UTC] matt at boltbluecorp dot com
Hello,

For a long time I've wished that PHP supported the "here" string syntax, i.e in Perl:

print <<EOF;
<html>
<body>
<font face="Arial" size="2">This is 
great for outputting HTML</font>
</body>
</html>
EOF

or better yet...

$string = <<EOS;
Hi, this is
a multi-line
string.
EOS

The second example is a must considering that PHP does not support output buffering, which is another feature that I believe is essential. It would be lovely to flush an output buffer and then issue an HTTP header like a cookie or a redirect. Let me just say that I love PHP, but this is one aspect in which it falls short of (forgive me) Active Server Pages.

Matt Flaherty

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-02 13:55 UTC] jeroen@php.net
Heredoc is supported, see the manual on strings.

You need three <<< , in stead of 2, and it works.
And output buffering is supported all the way since PHP 4, AFAIK...

See http://www.php.net/ob_start
 [2001-08-02 14:16 UTC] matt at boltbluecorp dot com
Wow, thanks for the quick feedback. And sorry. I looked hard but did not find these features. I stand corrected.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC