i have this french date format :
(Samedi, Aout 31, 2013)
and i want to get only the (M) of the date, for example for August i only want the (Aug)
PS : August in english = Aout in french
<?php
$date = 'Samedi, Aout 31, 2013';
$time = strtotime($date);
$month_only = date('M', $time);
echo $month_only;
$stamp = strtotime("Samedi, Aout 31, 2013");
$month = strftime("%b", $stamp);
...或更简洁地说:
echo strftime("%b", strtotime("Samedi, Aout 31, 2013"));
尝试:explode(" ","Samedi, Aout 31, 2013")[1]