PHP Coding Standards
Coding standards is a very important thing in web development. Code must be formatted in such a way that everyone can read it. Although you start a project on your own and don’t imagine anyone else seeing the source, there may come a time where you sell the site and a new developer will need to work on it. Or you have to hire a developer to work on the site. It is best if you stick to one clear format. I personally follow the zend coding standard. In this post I am going to explain a bit about how to format your code in such a way as you follow the Zend Standards. This will make your code clean and easy to use for any developer reading your code and make it easy for yourself to read.
General Rules
Number 1: You don’t use “?>”. PHP does not require it. Do not end your files with ?> just leave it blank. It should not change anything at all in your code. It also prevents accidental whitespace injection into your files. The exception is when the file is both php and html. Although that is also bad practice. PHP shouldn’t…


