Re: Functions vs html outpuit
| From: | M. Sokolewicz | Date: | Fri, 01 Sep 2006 14:44:19 +0000 |
| Subject: | Re: Functions vs html outpuit | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-241319@lists.php.net to get a copy of this message | ||
Dave Goodchild wrote:
Hi all, this may seem like a silly question, but I am creating a library of html form element generation function, for example a textarea fucntion that takes rows and cols as parameters, a function that generates a day, month and year select box, etc. My question is - is it significantly to switch off the parser and emit raw html than calling a function? If it is faster to just allow the server to send the html I will not bother.I'm not quite sure I understand your question. Are you asking if it's faster to parse and process a php script vs. a page of raw HTML? In that case, OF COURSE SERVING A RAW HTML FILE IS FASTER!!! Does the server have to do *anything* with the contents of the HMTL file? no Does the server have to do *anything* with the contents of the PHP file? yes! of course! it needs to parse and process it BEFORE it can actually server the RESULT of that script. So, if possible, stick to raw HTML files. - tul