<?
function GetMemory(){
		
		/* 内存占用情况 */
    if (function_exists('memory_get_usage')){
       
        $memory_usage = memory_get_usage();
        
        $unit=array('b','kb','mb','gb','tb','pb');
		
				return @round($memory_usage/pow(1024,($i=floor(log($memory_usage,1024)))),2).' '.$unit[$i];
    
    }else{
        
        $memory_usage = '0';
  	
  	}
		
}
?>