Skip to content

Instantly share code, notes, and snippets.

@tlkshadow
Created January 5, 2020 14:56
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 tlkshadow/9c9da1f09877a242765676d500237943 to your computer and use it in GitHub Desktop.
Save tlkshadow/9c9da1f09877a242765676d500237943 to your computer and use it in GitHub Desktop.
<?php
$data = [
'more' => [
'complex' => ['my value']
]
];
if (array_key_exists('more', $data) && array_key_exists('complex', $data['more']) && array_key_exists(0, $data['more']['complex'])) {
echo $data['more']['complex'][0];
}
echo ' ## ';
if (!empty($data['more']['complex'][0])) {
echo $data['more']['complex'][0];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment