Convert D/M/Y Date To Y/M/D Date in PHP

This is function convert form ‘DD/MM/YYYY’ to ‘YYYY/MM/DD’

function toYMDDate($mdyDate)
    {
        $mdyDate = explode("/",$mdyDate);
        krsort($mdyDate);
        return  implode("/",$mdyDate);
    }

Good luck!

Leave a Reply

Your email address will not be published. Required fields are marked *