检查数组是否为空或未在php中设置?

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.

if(isset($get['when']) && !empty($get['when']) ...

empty( $get['when'] ) will return true if $get['when'] is an empty string. See the manual's entry on empty for more info.