3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function getFormatDate($dateAFormate){ if ($dateAFormate==NULL) { $dateOk = ""; } else { $dateAFormate = explode("-",$dateAFormate); $jour = explode(" ",$dateAFormate[2]); $moi = ""; switch($dateAFormate[1]) { case 01: $moi="Jun"; break; case 02: $moi="Feb"; break; case 03: $moi="Mar"; break; case 04: $moi="Apr"; break; case 05: $moi="May"; break; case 06: $moi="Jun"; break; case 07: $moi="Jul"; break; case 08: $moi="Agu"; break; case 09: $moi="Sep"; break; case 10: $moi="Oct"; break; case 11: $moi="Nov"; break; case 12: $moi="Dec"; break; } $dateOk = $jour[0]." ".$moi." ".$dateAFormate[0]; } return $dateOk; } $date = '2014-09-01 00:00:00'; echo getFormatDate($date);
Output for 4.3.0 - 5.6.21
01 2014