Created
September 15, 2015 16:59
-
-
Save tarnus/00ef3f5389a922ceec17 to your computer and use it in GitHub Desktop.
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
/** | |
* @param $obj | |
* @param $field | |
* @param $value | |
* | |
* @return bool|null | |
*/ | |
function searchJson($obj, $field, $value) { | |
$item=NULL; | |
foreach($obj as $struct) { | |
if ($value == $struct->$field) { | |
$item = $struct; | |
return $item; | |
break; | |
} | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment