I want to get a date in a string in php and convert this date to other format:
eg: today is 02/03/2016
$string = preg_replace('~(\d{2})/(\d{2})/(\d{2,4})~', '', $string);
today is
$date = new DateTime($string);
$result = $date->format('F d, Y');
$string = 'today is 02/03/2016';
$string = preg_match('/\d{2}\/\d{2}\/\d{4}/', $string, $date);
$date = new DateTime($date[0]);
$result = $date->format('F d, Y');