I want to show percent CPU usage in PHP. Is not important if get values by cron in shell > output to file > parse in PHP or directly get value in php. I try many solutions f
I'm not 100% sure on what you're asking, but if I'm right, this answer might help you:
-1) { $cpuUsage += floatval($cols[2]); } } print($cpuUsage); ?>
The code provided was an answer from Devils Child for a similar question: https://stackoverflow.com/a/9846219/904242