how to remove the separator from the date input I have below
$date=$_POST["input"];
$new = date_format($date,"Y M D");
how to remove the separator from the date input I have below
$date=$_POST["input"];
$new = date_format($date,"Y M D");
Try this one
<?php
$date=$_POST["input"];
// prints the current time in date format
echo date("Y M D", strtotime($date))."\n";
?>
Use date_create() to change datatype from string to date
$date=date_create($_POST["input"];);
echo date_format($date,"Y M D");
Use strtotime
function convert date string into unix timestamp. Then convert into required format.
<?php
echo date("Y M D", strtotime($_POST["input"]));
?>