- Call things by their name — easy, short and readable variable and function names.
- Avoid globals.
- Stick to a strict coding style.
- Comment as much as needed but not more.
- Avoid mixing with other technologies.
- Use shortcut notation when it makes sense.
- Modularize — one function per task.
Can the element body be replaced with body?
You can only replace the HTML’s body element with PHP if you are outputting the HTML with PHP (changing it before outputting it). PHP works server-side, so once the HTML reaches the client it cannot modify it.
- Grasp The Basics More Thoroughly. …
- Use Functions To Define Different Modules, Even If They Are Small. …
- Keep Cross Browser Compatibility In Mind. …
- Use Object-Oriented Approach. …
- Perform Testing To Have A Near Perfect Code.