1$var = '20/04/2012';
2$date = str_replace('/', '-', $var);
3echo date('Y-m-d', strtotime($date));
4
1<?php
2// both lines output 813470400
3echo strtotime("19951012"), "\n",
4 strtotime("12 October 1995");
5
6// prints 1995 Oct 12
7echo date("Y-m-d", strtotime("19951012"));
8?>