Re: PHP and HTML
| From: | Carroll Barrett | Date: | Wed, 28 Jun 2000 17:01:27 +0000 |
| Subject: | Re: PHP and HTML | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-3599@lists.php.net to get a copy of this message | ||
In php4, you can use an echo statement of the form
echo <<< ENDOFECHO
<HTML>
<BODY BGCOLOR=$color>
Hello, $name, welcome to our site.
</BODY>
</HTML>
ENDOFECHO;
I like this method of entering HTML because you are not confused
by starting and closing php tags every time you need to display a
variable's contents.
Carroll Barrett
-----Original Message-----
From: Jason <jasonc@webpipe.net>
To: php-general@lists.php.net <php-general@lists.php.net>
Date: Wednesday, June 28, 2000 11:56 AM
Subject: RE: [PHP] PHP and HTML
>Even though it might be a bit faster to break in and out of PHP
to output
>straight HTML, I look at two things. Is it faster to write and
read? The
>speed advantages won't be huge so unless you're grasping for
every last
>microsecond, I wouldn't worry about it. Generally if I need to
output a
>huge block of HTML in a loop for instance, I'll break out of php
to type the
>html and then break back in. Alot faster than typing a million
echo
>statements. If I wanted that, I'd write servelts and their
blasted println
>statements....
>
>Jason
>
>> -----Original Message-----
>> From: Billy Harvey [mailto:Billy.Harvey@RhinoComputing.com]
>> Sent: Wednesday, June 28, 2000 10:18 AM
>> To: php-general@lists.php.net
>> Subject: RE: [PHP] PHP and HTML
>>
>>
>> > What is the break even point between more opening/closing
PHP
>> tags, and the
>> > overhead supplied by using echo statements and less
opening/closing PHP
>> > tags. At what point is one more beneficial than the other?
>> >
>> > Has anyone ever done any solid analysis on this? I would
be
>> interested in
>> > the results.
>> >
>> > Sam Masiello
>> > System Analyst
>> > Chek.Com
>> > (716) 853-1362 x289
>> > smasiello@chekinc.com
>>
>> Sam,
>>
>> I think it would difficult to assess a meaningful number.
Even
>> looking at just the Unix world alone at first, you'd have to
compare
>> several possibilities, such as php as a cgi, or php as an
Apache
>> module (and Apache is not the only server of course). The
variant of
>> Apache you used might have a significant effect because of its
>> interfacing. The version of php you used might be
significant. The
>> load on the system would definitely matter. Even isolating
the system
>> for just such a test would give rather meaningless results I
believe,
>> as few systems are going to be serving the same page
continuously, and
>> as php is best used in an environment where the customer is
making a
>> dynamic selection, often with multiple lookups on databases.
>>
>> I guess the whole point of the above is that unless echo is
*terribly*
>> inefficient (and outputting a string is about the simplest
thing an
>> interpreter can do), then the ease of use factor would be more
>> important.
>>
>> Most people here seem to like jumping in and out of php all
the time.
>> I'm not in that camp, and prefer to enter php at the beginning
and
>> leave it at the end. That way I know everything in between is
php
>> either calculating, fetching, or outputting. It helps me keep
things
>> straight.
>>
>> Heck, I even hate having to output Javascript - I want a
browser
>> module that can read php at the receiving end - but that's
another
>> subject.
>>
>> Billy
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
>> For additional commands, e-mail:
php-general-help@lists.php.net
>> To contact the list administrators, e-mail:
php-list-admin@lists.php.net
>>
>>
>
>
>_______________________________________________________
>Site Design, Hosting, and E-Commerce at www.webpipe.net
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
>For additional commands, e-mail: php-general-help@lists.php.net
>To contact the list administrators, e-mail:
php-list-admin@lists.php.net
>