Re: a quick date and session id question

From: Date: Mon, 16 Apr 2001 03:01:00 +0000
Subject: Re: a quick date and session id question
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-48692@lists.php.net to get a copy of this message
@ 10:56:48 PM on 4/15/2001, Brian Clark wrote: ... > function decipherDate($string, $format) > { Oops, you'll probably want to give $format a default value if one isn't passed. And maybe change the returns if you want to do something like: if(!decipherDate('blah')) ... > if(!$formatted = @date($format, strtotime($string))) > return 'Unable to understand decipher date string.'; > return $formatted; > } > /* Sunday, April 15 20001 */ > print decipherDate('20010415',"l, j F Y"); > print "\n"; > /* 'Unable to understand decipher date string. */ I may be dyslexic or something, I'm not sure. > print decipherDate('thisisgarbage234',"l, j F Y"); > print "\n"; > /* Tuesday, 8 March 2005 */ > print decipherDate('march 8, 2005',"l, j F Y"); > ?> -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies.

« previous php.general (#48692) next »