15 Tips to Optimize Your PHP Script for Better Performance for Developers

1. Use Native PHP Functions
As much as possible, try to use native PHP functions rather than writing your own functions to achieve the objective. For example, you can use range( b, k) to get an array of alphabets starting from b to k in sequence, if it is only needed once in the script rather than declaring an array with these values in a function and returning it on its call.

2. Use Single Quotes
Using single quotes ( ‘ ‘ ) is faster than using double quotes( ” ” ) if you are going to keep only the string inside it avoiding any variables. Double quotes checks for the presence of variable and adds little bit of overhead.

3. Use = = =
Use “= = =” instead of “= =”, as the former strictly checks for a closed range which makes it faster.

4. Use Appropriate Str Functions
str_replace is faster than preg_replace, but strtr is faster than str_replace by a factor of 4.

5. Calculate Only Once
Calculate and assign the value to the variable if that value is getting used numerous time rather than calculating it again and again where it is being used. For example, the following will degrade the performance.

6. Pass Reference to Function
Pass reference to the function if it does not affect your logic. A function manipulating the reference is faster than those manipulating the value been passed as here one more copy of the value is getting created. Especially it adds overhead when the value passed by you is a big array.

7. Create Classes Only When its Required
Don’t create classes and method until and unless its really needed, used and reused as well.

8. Disable Debugging Messages
File operations are expensive. So, if you have written lot of custom functions to log errors and warning during your development process, make sure you remove them before you push the code to production.

9. Use Caching Techniques
Use cache to reduce the load of database operations as well as the script compilation. We can use memcache for the reducing database load and APC for opcode caching and intermediate code optimization.

10. Close the Connection
Get into the habit to unset the variables and close database connection in your PHP code. It saves memory.

11. Reduce Number of Hits to DB
Try to reduce the number of hits to the database. Make queries aggregate so that you call the database less number of times.

12. Frequently Used Switch Cases
Keep most frequently used switch cases on the top.

13. Use Methods in Derived Classes
Methods in derived classes are faster than base classes. For example, let there be a function in both base class and derived class for performing task1. It is named as “forTask1? in base class and “forTask1again” in derived class, so that they will not override.

14. Use JSON
Use JSON instead of XML while working with web services as there are native php function like json_encode( ) and json_decode( ) which are very fast. If you are bound to have XML form of data, then use regular expression to parse it instead of DOM manipulation.

15. Use isset
Use isset( ) where ever possible instead of using count( ), strlen( ), sizeof( ) to check whether the value returned is greater than 0.
SOurce & Credit

15-tips-to-optimize-php-code
Tips in becoming a web designer
How to Be a Web Designer

So you want to become a web designer, but you have no idea where to start. Don't panic! It is not as hard as it seems, but it requires time and effort. It's very common to find self-taught web designers, but you've got to know where to start. In this post we'll be taking a look at the basic steps to become a web designer.

Web Design Things
24 Things to Consider When Designing and Developing a Website

From functionality and appearance to navigation and coding integrity, a lot goes into creating an eye-catching, user-friendly website. It doesn’t end there, either. Web developers and designers must work together to produce websites that will be located by search engines, engage customers, and stimulate conversions. Whew! That’s a lot of pressure. Fortunately, the following 24 tips will guide you through the process of creating a unique user experience that inspires viewers to become loyal brand advocates.

Digital Marketing To Boost Your Business
10 Digital Marketing Trends In 2015 That Will Boost Your Strategy

Digital marketing is an impulsive, erratic, and volatile industry. The moment you catch the tiger by the tail, there’s a new tiger whose fugacious tail requires catching. Keeping up with a changeable industry seems like a fool’s errand. Where is the balance between chasing capricious trends, on the one hand, and ossifying into a Luddite on the other?

SEO Company Mauritius
100 SEO Tips For Small Businesses

No SEO means no visitors from search engines. If you don’t do it then search engines can’t categorise and rank your site for keywords relevant to your business.