How to convert php date into mysql format

1. MySQL column datatype is "DATE"

$date = date('Y-m-d', strtotime(str_replace('-', '/', $date)));

2. MySQL column datatype is "DATETIME":

$date = date('Y-m-d H:i:s', strtotime(str_replace('-', '/', $date)));

Nikunj K

Phasellus facilisis convallis metus, ut imperdiet augue auctor nec. Duis at velit id augue lobortis porta. Sed varius, enim accumsan aliquam tincidunt, tortor urna vulputate quam, eget finibus urna est in augue.