PHP Technology

Secure PHP on the Web

PHP is a powerful and easy language to learn. As a developer, you must use that power in a safe and effective manner. While being easy to learn means that it is easy to pick up, it also means that you may not have any experience with writing secure code. Writing secure code is a must, however, if you do not want your server to be compromised, user data stolen, your site destroyed, or quite possibly worse. In this article, you will learn about writing more secure PHP code.


Syntax Bug, or Program Bug?

So, while coding today I came across a very strange bug in PHP. It seems as though subtracting two arrays will return null.

However, if I wrap that in the floor() function, it works as expected.

Go figure. Took me 30 minutes to find that annoying bug.