I have a php variable which contain date-time value like 2014-05-11 23:10:11 some times this may change, so i have to find it either it has date-time value or not, below is my variable
$my-variable='2014-08-26 18:25:47';
DateTime is a class in PHP. You should ask a different question if you want to validate a string. To validate a DateTime instance:
$my_variable instanceof DateTime
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With