This is a late answer but the accepted answer is based on the OP's question and not on the real format used by Last-Modified
header. There is a missing comma (,
) after the day of the week and the data order is not right.
The official format for Last-Modified header is:
Last-Modified: <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT
Therefore, the date format you get from the header should be different and the format to use already exists in the DateTime interface as DateTimeInterface::RFC7231
:
$str = "Fri,25 Oct 2013 12:04:10 GMT";
$datetime = DateTime::createFromFormat($fmt, $str);
echo $datetime->getTimestamp();
I know this is different from what the OP asked but the HTTP protocol has a different format than what was written by the OP.
This answer should be seen as complementary.
echo strtotime('Fri Oct 25 2013 12:04:10 GMT+0100');
=>1382699050
.strtotime()
IS able to parse this date format... – Mccown