Archive for the ‘PHP’ Category

Problems Identifying Domain Characters

Saturday, October 13th, 2007

Some time ago I was browsing Namepros (as I do on a daily basis) and came across a post which was mentioning about the usual fraudulent sales on eBay.

People regularly sell IDN’s on eBay but try and dress them up as premium names with a distinct rarity. (more…)

Got Bored So Wrote A Function

Wednesday, September 26th, 2007

I couldn’t sleep and was getting bored so I decided to write a function. I remember while reading a c++ book they showed you how to calculate the Fibonnaci number.

(more…)

The Importance Of A Good IDE

Tuesday, September 25th, 2007

Reading many forums, IRC channels and usenet’s I see many people bragging about how they can code without the use of an IDE. Although it is important for a programmer to have the ability to be able to program without such aids as an IDE to be more productive an IDE is a very important tool.

(more…)

The End Is Nigh

Monday, September 24th, 2007

Although it has been announced for some time a lot of people have as of yet to upgrade to PHP 5. The majority of people of course are at the complete mercy of their web host.

If your host has not upgraded yet you should of course take some preparation into ensuring that you will be prepared for when it does arrive. (more…)

Converting seconds to minutes and seconds

Sunday, August 26th, 2007

Some time ago I was in IRC and someone asked how to convert x amount of seconds into seconds and minutes. This is somewhat of an easy task and here is a simple function which can do exactly that (please note no effort was made so it would work with anything more than an hour):-

function sec_to_min($sec='')
{
if (ctype_digit((string)$sec))
{
$seconds = $sec % 60;
$minutes = ($sec-$seconds)/60;
$min_sec = $minutes.':'.str_pad($seconds, 2, '0', STR_PAD_LEFT);
return $min_sec;
}
else
{
return '0:00';
}
}

Ways in which this could be enhanced:-

  1. Make it more aware of whether any minutes exist.
  2. Enhance it so that it can also work with hours, days etc.