Ask a Question related to Dreamweaver AppDev, Design and Development.
-
jip #1
<<< EOPAGE html formatting in PHP?
I am running PHP 4.3.10.10, WinXP/IIS and I have been using some code examples
from the book, 'PHP/mySQL Bible'. There is an example where they use the
following script to format/render the html. This eliminates having to use the
echo or print statement: <?php // Now lay out the page //
-------------------- $page_str = <<< EOPAGE <html> <head> <title>PHP</title>
</head> <body> <div align='center'> <!-- place a variable in the query string
'bub=variableName' --> Test the code for $_GET[bub] </div> </body> </html>
EOPAGE; echo $page_str; ?> Evidently '$page_str = <<< EOPAGE' in conjuntion
with 'EOPAGE;' and 'echo $page_str;' eliminate the need for an echo statement.
All I know is that it works. Can anyone elaborate on this? Any feedback is
greatly appreciated.
jip Guest
-
html formatting within List Component
Hello. Due to drive failures, the source file for a little video viewer flash movie has been lost. it consists of a list component with the videos... -
adding HTML formatting to a datagrid
Hello, I have a datagrid in an .aspx page that I'd like to add some HTML formatting to: <asp:BoundColumn DataField="Pict1"... -
keeping html formatting in text
Hi I've got some text coming out of a database, but html markup isn't being turned into formatting. For example, the text in the database is: ... -
html formatting in flash
I have an textfield set to display html. When I include two hyperlinks with a space between, Flash is ignoring the space and placing the hyperlinks... -
formatting ruby code in html
Is there a similar function in Ruby to the highlight_file function of php...this function takes a file and outputs it in html.... ... -
-Rb #2
Re: <<< EOPAGE html formatting in PHP?
"jip" <chris.manning@eds.com> wrote in message
news:d2ham5$b9e$1@forums.macromedia.com...Check out heredoc syntax in the php documentation.>I am running PHP 4.3.10.10, WinXP/IIS and I have been using some code
>examples
> from the book, 'PHP/mySQL Bible'. There is an example where they use the
> following script to format/render the html. This eliminates having to use
> the
> echo or print statement: <?php // Now lay out the page //
> -------------------- $page_str = <<< EOPAGE <html> <head> <title>PHP</title>
> </head> <body> <div align='center'> <!-- place a variable in the query
> string
> 'bub=variableName' --> Test the code for $_GET[bub] </div> </body> </html>
> EOPAGE; echo $page_str; ?> Evidently '$page_str = <<< EOPAGE' in
> conjuntion
> with 'EOPAGE;' and 'echo $page_str;' eliminate the need for an echo
> statement.
> All I know is that it works. Can anyone elaborate on this? Any feedback is
> greatly appreciated.
>
< [url]http://www.php.net/docs.php[/url] >
HTH
-Rb
-Rb Guest
-
Joe Makowiec #3
Re: <<< EOPAGE html formatting in PHP?
On Thu 31 Mar 2005 12:06:13p, jip wrote in macromedia.dreamweaver.appdev:
Well, you are using an echo statement; you're just using a single echo> 'echo $page_str;' eliminate the need for an echo statement.
> All I know is that it works. Can anyone elaborate on this?
to output a whole long string.
The syntax you're seeing:
$page_str = <<< EOPAGE
....
EOPAGE;
is known as 'heredoc':
[url]http://us4.php.net/manual/en/language.types.string.php#language.types.string.sy ntax.heredoc[/url]
Joe Makowiec Guest



Reply With Quote

