How to split a string which is separated by an Element in PHP -


i have variable containing date , time has been separated element " t "

$date_time="2013-05-05t18:30:00"; 

now want date in 1 variable , time in variable below.

$date="2013-05-05"; $time="18:30" 

if trying split it, can use explode() along list()

list($date, $time) = explode('t', $date_time); echo "date: $date time: $time"; 

you may want in php's datetime class if you're looking processing this.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -