Created
February 16, 2015 11:22
-
-
Save umanda/8ef64b59443cc1518322 to your computer and use it in GitHub Desktop.
Illegal string offset Warning PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isset_get($array, $key, $default = null) { | |
return isset($array[$key]) ? $array[$key] : $default; | |
} | |
$myVar = isset_get($someArray, 'someKey'); | |
//or with some default if you got one | |
$myVar = isset_get($someArray, 'someKey', $mydefault); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment