Home > Article > Backend Development > PHP gets memory usage status memory_get_usage() function_PHP tutorial
The memory_get_usage function is provided for you in php, which can check the memory currently used by your server. With this function, we can check the server status in real time. Let me introduce the usage of memory_get_usage.
Format memory_get_usage() output
The code is as follows
|
Copy code
|
||||
function convert($size){
| Output: 256 kb
Example