<?php $someString = "2014-01-01 12:00:01'; select * from users;"; echo "Valid date\n"; else echo "Invalid date\n";
Standard input is empty
Valid date array(13) { ["year"]=> int(2014) ["month"]=> int(1) ["day"]=> int(1) ["hour"]=> int(12) ["minute"]=> int(0) ["second"]=> int(1) ["fraction"]=> float(0) ["warning_count"]=> int(1) ["warnings"]=> array(1) { [31]=> string(29) "Double timezone specification" } ["error_count"]=> int(6) ["errors"]=> array(6) { [19]=> string(20) "Unexpected character" [20]=> string(20) "Unexpected character" [22]=> string(47) "The timezone could not be found in the database" [29]=> string(20) "Unexpected character" [36]=> string(29) "Double timezone specification" [41]=> string(20) "Unexpected character" } ["is_localtime"]=> bool(true) ["zone_type"]=> int(0) }