How to easily detect mobile devices

Nowadays people want to offer mobile versions of their websites or web applications to their mobile users. Even though some mobile vendors explicitly state it is not necessary to develop a trimmed down version because they want their users “to experience the real internet”. But in most cases you don’t want your mobile visitors to stop from returning because they went through their data plan to quickly because of all the extra “bulk” on your site. They just want your content. Continue reading “How to easily detect mobile devices”

How to zero fill a number in PHP

A while ago I needed to automatically zero fill a number for a quoting system I was working on. I decided to browse the internet to search for a simple code snippit but I could only find code with a while loop that would keep adding zeroes untill the desired string length was reached. Although this seemed okay, I realized it could be done much cleaner, and most important, less draining for system resources. So I wrote the following function. Continue reading “How to zero fill a number in PHP”