<?
$jsonString = <<<DATA
{
"result": { ...... }
}
DATA;
define("SEARCH_STRING", 2);
$jsonArray = json_decode($jsonString, true);
foreach ($jsonArray['result']['items'] as $key => $value) {
if ($value['defindex'] == SEARCH_STRING) $need_key = $key;
}
if ($jsonArray['result']['items'][$need_key])
print_r ($jsonArray['result']['items'][$need_key]);
?>