Skip to content

Instantly share code, notes, and snippets.

View StefanoTesla's full-sized avatar
🏠
Working from home

StefanoTesla StefanoTesla

🏠
Working from home
View GitHub Profile
@mehdichaouch
mehdichaouch / memory_usage.php
Last active April 11, 2024 15:55
PHP Snippet to get human readable memory usage
<?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];
}
convert(memory_get_usage());