Answers for "php dateperiod reverse"

PHP
1

convert date to reverse date in php

<?php 
//This function convert date from any format to any format
function reformatDate($date, $from_format = 'd/m/Y', $to_format = 'Y-m-d') {
    $date_aux = date_create_from_format($from_format, $date);
    return date_format($date_aux,$to_format);
}

//Calling Funciton 
reformatDate($date);
?>
Posted by: Guest on September-12-2021

Browse Popular Code Answers by Language