Skip to content

Instantly share code, notes, and snippets.

@dypsilon
Created June 4, 2011 23:09
Show Gist options
  • Save dypsilon/1008471 to your computer and use it in GitHub Desktop.
Save dypsilon/1008471 to your computer and use it in GitHub Desktop.
The power of empty
<?php
if(isset($someArray) && is_array($someArray)
&& array_key_exists('firstKey', $someArray)
&& array_key_exists('secondKey', $someArray['firstKey'])
&& array_key_exists('thirdKey', $someArray['firstKey']['secondKey'])) {
echo $someArray['firstKey']['secondKey']['thirdKey'];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment