<?php $string = '21-11-2016'; $pattern = '/(\d{2})-(\d{2})-(\d{4})/'; $rep = "Month: $2 , Day: $1 , Year: $3"; echo preg_replace($pattern, $rep, $string);
You have javascript disabled. You will not be able to edit any code.