PHP 8.5.0 Alpha 1 available for testing

Voting

: max(three, two)?
(Example: nine)

The Note You're Voting On

xelozz -at- gmail.com
15 years ago
To get the memory usage in KB or MB

<?php
function convert($size)
{
$unit=array('b','kb','mb','gb','tb','pb');
return @
round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];
}

echo
convert(memory_get_usage(true)); // 123 kb
?>

<< Back to user notes page

To Top