PHP

This is a little tip to help programmers and system admins shave off a few milliseconds from their daily command line interface workflow. For the uninitiated, please note that some programmers, including yours truly, have been reported to spend hours or even days trying to automate a repetitive task that takes 5 seconds to execute....


Introduction

If you want to declare an array as a constant in PHP, you need to look further than what PHP provides as standard. Technically, if you look at PHP's Constants Syntax, it's not possible to define an array as constant, except from PHP 5.6 onwards. As of this writing, PHP 5.6 is still not widely available, and hence here's...


The time() function in PHP returns the current Unix timestamp; which is the time measured in the number of seconds since the Unix Epoch. Very useful in certain cases, but not always. This function, like most other PHP functions, is also cross platform compatible as it works on Unix, Linux, Windows, and Mac.

PHP's microtime()...


Introduction

Generating ANSI (or ASCII) command line colors, or terminal colors, or whatever you call them, is easy with PHP. As I have said in my previous post, ANSI Command Line Colors under Windows, having colored text in the command line is a great help for spotting error or success messages. So here’s a quick and dirty function...


Introduction

You are programming in PHP and you have an array variable that you'd like to explore at different execution paths. Of course, the best way is to use a PHP debugger like xdebug or Zend Debugger, but, what happens when you're too lazy to install a debugger? What happens when you don't want or can't install a debugger and...