There is a SWIG mapscript reference to a "layerObj" method "getResults()" returning a resultCacheObj. The resultCacheObj has an attribute "bounds" which is the extent of the results. Is this available in PHP mapscript. It seems to be missing. Worth