numlayers; $i++) { $oLayer = $oMap->getLayer($i); if($oLayer->getNumResults() > 0) { $n++; } } fwrite($stream, $n); /* now write the result set for each layer */ for($i=0; $i<$oMap->numlayers; $i++) { $oLayer = $oMap->getLayer($i); $nResults = $oLayer->getNumResults(); if( $nResults > 0) { fwrite($stream, $i); fwrite($stream, $nResults); //write the bounds of the result, there are none in php? fwrite($stream, (double)0); fwrite($stream, (double)0); fwrite($stream, (double)0); fwrite($stream, (double)0); //write each of the results for ($j=0; $j<$nResults; $j++) { $result = $oLayer->getResult($j); fwrite($stream, (int)$result->shapeindex); fwrite($stream, (int)$result->tileindex); fwrite($stream, (int)$result->classindex); } } } fclose($stream); return true; } ?>