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 October 14, 2024 10:53
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());