I'm currently using:
if (isset($get['when']) && !strtotime($get['when']) && strtotime($get['when']) < time())
But i would also like it to include a way to check if $get['when'] is empty('')
. How do I do this in the best manner?
I'm currently using:
if (isset($get['when']) && !strtotime($get['when']) && strtotime($get['when']) < time())
But i would also like it to include a way to check if $get['when'] is empty('')
. How do I do this in the best manner?
if (isset($get['when']) && !empty($_GET['when']) && !strtotime($get['when']) && strtotime($get['when']) < time())
Use the empty function straight after you check that $_GET['when'] is set.