Hi Sandeep,

@ 10:33:16 PM on 4/15/2001, Sandeep Hundal wrote:

...
> NOw they will probably be given a form which allows them to choose,
> and then gets inputted into the datase as a number : YYYYMMDD. But I
> want to display the data as "Monday, 20 April 2001. How can I do
> this?

Yes, with strtotime():

<?php

function decipherDate($string, $format)
{
   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. */
print decipherDate('thisisgarbage234',"l, j F Y");

print "\n";

/* Tuesday, 8 March 2005 */
print decipherDate('march 8, 2005',"l, j F Y");

?>

...
> Secondly, Anyone know fof a good tutorial explaining what sessionid's
> in php are for and how to use them??

Try here: <http://www.phpbuilder.com/columns/mattias20000105.php3>


-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]

Reply via email to