With a date string of Apr 30, 2010
, how can I parse the string into 2010-04-30
using PHP?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Correctly parse PDF paragraphs with Python
- Can php detect if javascript is on or not?
Try http://php.net/manual/en/function.strtotime.php to convert to a timestamp and then http://www.php.net/manual/en/function.date.php to get it in your own format.
Either with the DateTime API (requires PHP 5.3+):
or the same in procedural style (requires PHP 5.3+):
or classic (requires PHP4+):