Write a PHP script to get the information regarding memory usage in KB or MB etc.
<?php $memory_size = memory_get_usage(); $memory_unit = array('Bytes','KB','MB','GB','TB','PB'); // Display memory size into kb, mb etc. echo 'Used Memory : '.round($memory_size/pow(1024,($x=floor(log($memory_size,1024)))),2).' '.$memory_unit[$x]."\n"; ?>
Sample Output:
Used Memory : 342.57 KB
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer