First, note that it is not possible to detect whether text belongs to a specific undesired encoding. You can only check whether a string is valid in a given encoding. You can make use of the UTF-8 validity check that is available in preg_match since PHP 4.3.5. It will return false (with no additional information) if… Read More

Having worked with CodeIgnighter for many years, I’ve crafted the following the following HTACCESS script to meet most CI needs.

 … Read More

Here’s a question guaranteed to make your stomach lurch: “Would you mind if I gave you some feedback?” What that means is “Would you mind if I gave you some negative feedback, wrapped in the guise of constructive criticism, whether you want it or not?” The problem with criticism is that it challenges our sense… Read More

Hiring the best of the best is an absolute must if you are going to build a successful company.  You will need to be prepared to compete against big companies with deep pockets and other up-and-coming startups that also have blue chip investors and a game-changing idea.   So, what are the most competitive areas… Read More

I thought this was a great quote about the “perception of value” from an article explaining why Apple has not changed the design of the iPhone for many years now. Apple is not and will not change things just for the sake of change. And while some may now be clamoring for this change, the paradox… Read More

How to tell to AngularJS that a site is a trusted host, You can use $sce.getTrustedResourceUrl() to trust the URL.

You may optionally configure $sceDelegateProvider to white list the URLs. Reference:$sce#getTrustedResourceUrl… Read More

In general, there are 2 solutions to this problem: 1. Use $_SERVER[“DOCUMENT_ROOT”] – We can use this variable to make all our includes relative to the server root directory, instead of the current working directory(script’s directory). Then we would use something like this for all our includes:

2. Use dirname(__FILE__) – The __FILE__ constant… Read More

Error settings in php.ini tell PHP interpreter what kind of errors should be reported and where those should be reported. You may enable these settings in your development environment and disable few in your production environment since useful information error reports provide can also be sensitive information that outsiders shouldn’t see. display_errors  Default value of… Read More

Here is an easy way to create HTML select menus for Month/Day/Year. Create three arrays containing the range of values for days, months, years.  Then loop over each array generating the required option tags for each select menu.

 … Read More

The quickest method for generating a unique PIN number of 10 characters in length. We are taking the smallest part of micro-time (milliseconds), encrypting it with MD5, then shuffling the string itself. This creates a very random blend of letters and numbers.

 … Read More