运行 ❯
获取自己的
PHP
服务器
×
更改方向
更改主题,深色/浅色
转到 Spaces
<!DOCTYPE html> <html> <body> <?php $date = "1970-01-01 00:00:00"; $pattern = "/[-\s:]/"; $components = preg_split($pattern, $date); print_r($components); ?> </body> </html>
Array ( [0] => 1970 [1] => 01 [2] => 01 [3] => 00 [4] => 00 [5] => 00 )