Simplify your business
Thursday, 24 July 2008 4:15 am

Converting PHP arrays to XML

Thursday, 1 November 2007  

I thought I’d share with you a PHP class I found useful lately. I had to take a comma-delimited text file and turn it into an XML text stream. With the ubiquity of XML these days, you might find it useful too, if you dabble in PHP software development.

Read more >>


Looking for a new text editor

Tuesday, 28 August 2007  

Over the last eight years I’ve been exclusively using Notetab for all my text editing needs in the Windows environment. Simple to use, really intuitive and very powerful. Great for editing multiple files too.

Read more >>


The most useful PHP function?

Wednesday, 4 July 2007  

I know that PHP has a lot of functions built right in, some of which are used frequently and some sparingly. But what about “home made” functions that we’ve created? Which are the most used?

Read more >>


PHP leap year calculation

Saturday, 24 March 2007  

A simple little function to calculate whether a specified year is a leap year or not:

function isleapyear($year = '') {
   if (empty($year)) {
      $year = date('Y');
   }
   $year = (int) $year;
   if ($year % 4 == 0) {
      if ($year % 100 == 0) {
         return ($year % 400 == 0);
      } else {
         return true;
      }
   } else {
      return false;
   }
}

The algorithm applied above, translated to everyday language, is something like this:

If the year is divisible by 100, then it’s not, unless the year is divisible by 400, when it is. Otherwise, if the year is divisible by 4, then it is. Otherwise, it’s not.

Did you get all that? I know, it’s probably easier to understand by looking at the code.


Click on the logo and break the website

Friday, 16 March 2007  

On the web, it’s standard practice to have your logo a clickable link which takes the visitor to your home page. Although I have seen the occasional business website which doesn’t allow you to click on the logo, I haven’t seen any that break the website when the logo is clickable.

Read more >>


Next page