bool checkdate ( int $month , int $day , int $year )
<?php $date = "01-01-1980 <script>alert('test');</script>"; $aDate_parts = preg_split("/[\s-]+/", $date); var_dump( checkdate( $aDate_parts[1], // Month $aDate_parts[0], // Day $aDate_parts[2] // Year ) ); ?>