Skip to content

Instantly share code, notes, and snippets.

@dypsilon
Created June 4, 2011 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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