$thisdate = '2011-01-18 14:52:33';
$security = preg_replace('/[^\d\s]/', '', $thisdate);
echo $security;
This results in 20110118 145233
How would i get rid of the space?
Thanks.
While changing the regex is definitely the superior answer...
str_replace can also work.
$security = str_replace($security, '\s', '');