PHP Datetime Convert slash to minus
I want to convert my datetime 08/11/2013 to 2013-08-11.
I was trying this, but it did not work as it suppose to.
$date = $_POST['gt_date']; // Getting 08/11/2013
$date = explode("/", $date); // Exploding the / character into array
$datetime = $date[2] + '-' + $date[0] + '-' + $date[1];
Any Ideas?
No comments:
Post a Comment