RE: [PHP] Heavy Load

From: Date: Fri, 25 Aug 2000 01:43:18 +0000
Subject: RE: [PHP] Heavy Load
Groups: php.general 
Request: Send a blank email to php-general+get-13557@lists.php.net to get a copy of this message
Just to add to what you wrote there, sometimes you will need to use strings to output some html or just text, there's a nice trick, if your file uses lot's of text to pass trought functions, variables and echos use single quotes: The following are equale: =============================================== echo "As mentioned in other mails the load will not be the same. Each page w...."; // ex.1 : // Here we are having double quotes, // They are always having an additional parser to see // if any function/variable were included inside.... =============================================== echo 'As mentioned in other mails the load will not be the same. Each page w....'; // ex.2 : // Single quotes are not being parsed for anything extra, // PHP would output what captured by '' just as it is here... // That also means if you would write something like // echo '<br>whatever $MyVariable'; // it would output just as it written there // without changing $MyVariable with it's value. =============================================== -----Original Message----- From: Lars Holm Nielsen [mailto:lars@xenux.dk] Sent: Friday, August 25, 2000 2:30 AM To: Larentium; php-general@lists.php.net Subject: RE: [PHP] Heavy Load > If all of the html files on a site were PHP files, would it put an extra load an > Apache Server with the PHP module for having to process all of the files? Say if > you wanted to use a PHP header and footer on every html page. Or is the work load > almost the same for plain html files and PHP files with simple includes or print > commands? As mentioned in other mails the load will not be the same. Each page would have to go through PHP, before httpd would sent it. Though, the difference wouldn't be very big, while PHP just let normal HTML run through without any check. Therefore, for instance, it's also faster to have normal HTML outside the PHP tags, instead of letting PHP writing it like: ---fast------ <?//PHPFILE?> <b>some html</b> ---slower------ <?//PHPFILE echo "<b>some html</b>"; ?> ---- The differnece aren't big, but it's there. --- Regards, Lars Holm Nielsen <lars@xenux.dk> XENUX ApS - The Linux People http://www.xenux.dk -- 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

« previous php.general (#13557) next »