This question already has an answer here:
- Convert one date format into another in PHP 15 answers
$sqldate = "2016-07-18"; $newDate = date("d-m-Y",$sqldate);
I also use
implode('-', array_reverse(explode('/', $sqldate)));
I am trying to convert a date from yyyy-mm-dd to dd-mm-yyyy (but not in SQL); however I don't know how the date function requires a timestamp, and I can't get a timestamp from this string.
I am getting particular date format. WHY? I tried get a date expected format, i tried php date but no success..
I excpected output