Re: [PHP] breaking a string into chunks

2003-09-19 Thread Duncan Hill
On Friday 19 Sep 2003 10:20, David T-G wrote: Hi, all -- Now it's my turn to ask a simple question, or one that sure sounds like it should be... I have a 14-char date string like 20030917181909 and I need to break it into its component parts for a more readable 2003-09-17 18:19:09 view.

Re: [PHP] breaking a string into chunks

2003-09-19 Thread Marek Kilimajer
you can call preg_match, and only once David T-G wrote: Hi, all -- Now it's my turn to ask a simple question, or one that sure sounds like it should be... I have a 14-char date string like 20030917181909 and I need to break it into its component parts for a more readable 2003-09-17 18:19:09

Re: [PHP] breaking a string into chunks

2003-09-19 Thread David T-G
Duncan, et al -- ...and then Duncan Hill said... % % On Friday 19 Sep 2003 10:20, David T-G wrote: % % I have a 14-char date string like 20030917181909 and I need to break it % into its component parts for a more readable 2003-09-17 18:19:09 view. % How can I do that? Do I really need to

RE: [PHP] breaking a string into chunks

2003-09-19 Thread Javier Tacon
Make your own function, for example: function transformDate($format,$str) { $d = Array(); for($i=0;$istrlen($str);$i+=2) { $d[]=substr($str,$i,2); } return date($format,mktime($d[4],$d[5],$d[6],$d[2],$d[3],$d[0]$d[1])); } print transformDate(Y-m-d H:i:s,20030917181909); So, you can

Re: [PHP] breaking a string into chunks

2003-09-19 Thread Curt Zirzow
* Thus wrote Duncan Hill ([EMAIL PROTECTED]): On Friday 19 Sep 2003 10:20, David T-G wrote: Hi, all -- Now it's my turn to ask a simple question, or one that sure sounds like it should be... I have a 14-char date string like 20030917181909 and I need to break it into its component