Jump to content

writing html in php coding


brown2005

Recommended Posts

If you can avoid writing your HTML through PHP then I would.  Apache can parse HTML and send it to the browser faster than Apache loading PHP, then PHP's interpreting engine parsing it and sending it to Apache to send to the browser.

 

Client side should stay client side and server side should stay server side.

Okay well good luck with that phpORcaffine, i have no idea how client side should be client side a it applies here!

 

if your file is assoated with php (has a .php extenstion) then its going to be parsed, how you handle the html in that file really depends on what your doing

 

I have found that stepping in and out of PHP is very slightly slower than echoing the data,

for example

<?php
$example1 = "some text";
$example2 = "some text";
$example3 = "some text";
echo "<input type=\"text\" value=\"$example1\"><br />\n";
echo "<input type=\"text\" value=\"$example2\"><br />\n";
echo "<input type=\"text\" value=\"$example3\"><br />\n";
?>

 

is quicker than

<?php
$example1 = "some text";
$example2 = "some text";
$example3 = "some text";
?>
<input type="text" value="<?php echo $example1; ?>"><br />
<input type="text" value="<?php echo $example2; ?>"><br />
<input type="text" value="<?php echo $example3; ?>"><br />

 

BUT

 

tons of html
<?php echo "hello word";?>
tons of html

would be quicker than echoing the 2xtons

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.