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
Post a Comment