Democreous Posted February 2, 2007 Share Posted February 2, 2007 I have an edit time code that draws a time that was previously entered from mysql(using the time field) and allows the user to edit the Hour, Minute, and second of that events time. I am wondering how to break apart the time so I can work with the Hours, minutes, and seconds separately, rather than as a whole (eg instead of $time=HH:MM:SS , have $hour=HH $min=MM & $sec=SS variables drawn from mysql) Link to comment https://forums.phpfreaks.com/topic/36827-solved-separating-hhmmss/ Share on other sites More sharing options...
Orio Posted February 2, 2007 Share Posted February 2, 2007 Use explode(). <?php //$time is in the format HH:MM:SS list($hour, $min, $sec) = explode(":", $time); echo $hour."<br>"; echo $min."<br>"; echo $sec; ?> Orio. Link to comment https://forums.phpfreaks.com/topic/36827-solved-separating-hhmmss/#findComment-175695 Share on other sites More sharing options...
Democreous Posted February 2, 2007 Author Share Posted February 2, 2007 sweet, thanks alot! Link to comment https://forums.phpfreaks.com/topic/36827-solved-separating-hhmmss/#findComment-175703 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.