ok grazie ma non mi funziona il codice mi da sempre falsee quindi stampa sempre not found

codice:
function search($anArray,$aKey,$aValue) {
	foreach ($anArray as $key => $value) {
		if ($value[$aKey]==$aValue) {
			return $value;       
		} 
	 } 
	 return false;
}  

	$image =array();

	$index=0;
	
	while($column=mysql_fetch_array($listaimage2)){
		$image[$index++]=array('idz'=>$column[idz],'idxtipo'=>$index,'titleimg'=>$column[titleimg],'imgname'=>$column[imgname], 'table'=>'News', 'directory'=>$column[directory]);
	}
	
	while($column=mysql_fetch_array($listaimage3)){
		$image[$index++]=array('idz'=>$column[idz],'idxtipo'=>$index,'titleimg'=>$column[titleimg],'imgname'=>$column[imgname], 'table'=>'Game');
	}
	$image[]=array('idz'=>9999,'idxtipo'=>9999,'titleimg'=>utima,'imgname'=>imgname);

	$indeximg=0;
	$contarighe = 0;

	$thisimage = search($image,'idz',$id);
	if ($thisimage == false) {
		print "not found";
	} else {
		echo"$thisimage[idz] - $thisimage[idxcate] - $thisimage[directory]  ";
	}