brown2005 Posted July 16, 2009 Share Posted July 16, 2009 Hi, I find it easier writing all my code in php, but will this make my website more slower? Quote Link to comment https://forums.phpfreaks.com/topic/166183-writing-html-in-php-coding/ Share on other sites More sharing options...
phporcaffeine Posted July 16, 2009 Share Posted July 16, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/166183-writing-html-in-php-coding/#findComment-876335 Share on other sites More sharing options...
MadTechie Posted July 16, 2009 Share Posted July 16, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/166183-writing-html-in-php-coding/#findComment-876337 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.