Get your own PHP server Result Size: 625 x 565
x
 
<!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
)