Does PHP have an inverse of the date() function (other than strtotime())?

前端 未结 7 544
别跟我提以往
别跟我提以往 2021-01-17 14:53

Is there a function that uses the date() format to interpret a string?

echo date(\'s-i-H d:m:Y\', 1304591364); // 34-29-17 05:05:2011

// Does t         


        
7条回答
  •  执念已碎
    2021-01-17 15:21

    Try this to reverse:

    $x = '2013-09-15';

    $x = implode('-', array_reverse(explode('-', $x)));

    // now $x = '15-09-2013'

提交回复
热议问题