note 11717 deleted from function.str-pad by felipe

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
Note Submitter: rob at OhReally dot com 

----

To reformat the date "3-3-2001" to "2001-03-03" you would use this regexp:

$newdate = preg_replace("/([0-9]+)-([0-9]+)-([0-9]+)/ie", "'\\3-'.str_pad('\\2', 2, '0', STR_PAD_LEFT).'-'.str_pad('\\1', 2, '0', STR_PAD_LEFT)", $date);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.