1. 24 Jul 2011
  2. 3pm ( 1 comment )

    I  recently had a project that needed to validate Irish mobile phone numbers. Here is the PHP function I used in case anyone needs to do the same again.

    The function returns FALSE if the number is not in a valid format or else it returns the mobile number in the format 003538XXXXXXXX. It can deal with odd formated numbers such as (086) 1234123, +353861234123 etc.

    function validate_number($number) {
    
    	$number = preg_replace('/\D/', '', $number); //Strip all non numeric characters
    
    	$length = strlen($number);
    
    	// Strip the 00353, 353 or 0 from the start of the number
    	if ($length == 10) // 08XXXXXXXX
    	{
    		$number = substr($number, 1);
    	}
    	elseif ($length == 12) // 3538XXXXXXXX
    	{
    		$number = substr($number, 3);
    	}
    	elseif ($length == 14) // 003538XXXXXXXX
    	{
    		$number = substr($number, 5);
    	}
    	else // Not a valid number
    	{
    		return FALSE;
    	}
    
    	if (preg_match('/8\d{8}$/', $number)) {
    		//Number must have an '8' followed by eight other digits i.e. 8XXXXXXXX
    		return $number;
    	}
    	else // Not a valid number
    	{
    		return FALSE;
    	}
    }
    
  3. 27 May 2011
  4. 10am

  5. 06 May 2011
  6. 6pm

    Trinity Orchestra plays Daft Punk

  7. 8am

    Lisa Hannigan – “Just like Tom Thumb’s blues” Live in Dick Mac’s in Dingle.

  8. 28 Apr 2011
  9. 12am

    The north face was first climbed on July 24, 1938 in three days. Ueli Steck set the record for climbing it in 2 hours 47 min.

  10. 27 Apr 2011
  11. 8pm

    “Marc Newson’s latest creation for Ikepod sees the Australian designer interpret the most iconic timepiece of all: The Hourglass. Director Philip Andelman traveled to Basel, Switzerland, to document the designer’s modern take of the classic hourglass inside the Glaskeller factory. Each hand made hourglass comprises highly durable borosilicate glass and millions of stainless steel nanoballs, and is available in a 10 or 60 minute timer.”

    (via Ikepod.com)

  12. 26 Apr 2011
  13. 7pm

    ReCaptcha and DuoLingo. Solving big tasks one word at a time.