// return bytes
function getVariableSize ( $foo )
{
$tmpfile = "temp-" . microtime(true) . ".txt";
file_put_contents($tmpfile, $foo);
$size = filesize($tmpfile);
unlink($tmpfile);
return $size;
}
from : http://stackoverflow.com/questions/2192657/how-to-determine-the-memory-footprint-size-of-a-variable
沒有留言:
張貼留言