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
you can use "top -n 1" for getting cpu percentage. this command runs top only once, then gives output. i think you can do the parsing part on your own.