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. Quote 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 Quote 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 Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/74714-parting-of-string/#findComment-377714 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.