5 Steps to speed up your PHP pages
-
sprintf
is much faster than using variables in double quotes - PHP5 has introduced
$_SERVER[’REQUEST_TIME’]
which has the script execution start time. So you can avoid usingmicrotime()
ortime()
functions. - When parsing with XML in PHP try
xml2array
. This function uses the PHP XML functions. So it would be better than calling specific functions for each data. -
else if
is much faster thancase
/switch
-
echo
for a fasterprint
Written by Mathew Paret
Related protips
2 Responses
I would say the above mentioned has a very small effect on overall performance. What about things like Xcache and eAccelerator?
over 1 year ago
·
And our old friend "micro optimization" is back. This reminds me of "use single quotes instead of double quotes to speed things up".
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#