xsubs Posted October 25, 2007 Share Posted October 25, 2007 I have this string: "10/24/07 6:01" I want to "Part" it to 10/24/07, and 6:01. How can i do it? Thanks. Link to comment https://forums.phpfreaks.com/topic/74714-parting-of-string/ Share on other sites More sharing options...
Zane Posted October 25, 2007 Share Posted October 25, 2007 try using the strtotime() function http://www.php.net/strtotime Link to comment https://forums.phpfreaks.com/topic/74714-parting-of-string/#findComment-377707 Share on other sites More sharing options...
kenrbnsn Posted October 25, 2007 Share Posted October 25, 2007 You can use the explode() function: <?php list ($date,$time) = explode(' ','10/24/07 6:01'); echo $date . ' .... ' . $time . '<br>'; ?> Ken Link to comment https://forums.phpfreaks.com/topic/74714-parting-of-string/#findComment-377709 Share on other sites More sharing options...
Zane Posted October 25, 2007 Share Posted October 25, 2007 wow that didn't even cross my mind Link to comment https://forums.phpfreaks.com/topic/74714-parting-of-string/#findComment-377714 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.