@ 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.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]