codice:
$data="13/12/2004";
echo preg_replace("/([\d]{2})([\/])([\d]{2})([\/])([\d]{4})/","\\5-\\3-\\1",$data);