June 22, 2013 Posted by Victor in Frameworks & Tools, PHP best practice

Tips for PHP Developers

Highly-acclaimed sites like Facebook and Wikipedia use PHP as the best web development language. Those who are at the beginning of their PHP developer career should definitely skim through these time- and energy-saving tips and tricks offered by professionals.
     First of all you must use an appropriate source editor to avoid problems and extra time spent with development. When looking for softwares make sure you look for syntax highlighting as one of the must have features. Moreover, you can opt for source editors that have debugging or code hinting tools too. Skim through the list of editors like Notepad++, TextMate or Coda to find the software you can work with.

   One of the most important things you should do is to create a configuration file. The master file that contains all settings can be included in the PHP scripts without having to bother with the correction of various files in case you want to make some important changes.

    Furthermore, you are advised to use PHP core functions and classes. Read the PHP manual before starting to create your own unique functions. There are numerous native PHP functions you can use to ease your job, all you have to do is read their definition and insert these into the right place.

    Build your apps in a completely safe environment by leaving the error report turned on. This function will help you correct errors on the spot. Fix the problems as soon as possible in order to be able to go on with the development. When you finished the application make sure you turn off this function. 

    Pro PHP developers recommend you to sanitize your data before you incorporate these into your database. It's time to get familiarized with the PHP function  that allows you to offer full protection to your database. Use  mysql_real_escape_string to sanitize data in the shortest time. Beware of damaging cross-site scripting attacks with this smart function.

    In addition to all these tips you can also think about saving the code snippets you'll use several times during the PHP development projects. Isn't it great? Numerous apps allow you to save different parts of a code like: Code Collector, Snippet or Snipplr. However, you can also use the special features of different IDEs (integrated development environments) like Dreamweaver or Eclipse to store your codes in an accessible place.


Click to share thisClick to share this