Helping ordinary people create extraordinary websites!

Develop Rock-Solid Code In PHP: Lay The Foundation, Part 1

By Amol Hatwar
2004-01-21

Make it platform-independent
Another issue that you must address is platform-independence. Of course, scripts written for PHP on Windows will work on PHP on any other platform: PHP is designed that way. However, you still need to take care of minor inconsistencies. The new line character, for instance, is represented differently in Windows and UNIX.

You must also use abstraction when accessing resources like databases that are external to PHP. Say your application uses MySQL as a database server to cut costs. If you decide to have a more feature-rich database later, you will have to change the code in your application. Making massive changes to code is always a drudgery and an error-prone process. Using abstraction isolates changes to parts that can be easily changed. You do not have to redo the entire application.

Ensure that you write platform-independent code. It makes your application more adaptable and scalable.



Tutorial pages:

First published by IBM developerWorks


 1 Votes

You might also want to check these out:


Leave a Comment on "Develop Rock-Solid Code In PHP: Lay The Foundation, Part 1"
You must be logged in to post a comment.

Link to This Tutorial Page!


GET OUR NEWSLETTERS