I\'m trying to export the output of the \"top\" command (unix) with PHP. Invoking and reading the command/output is pretty simple using the \"exex\" function but the question is
As mentioned by Lucas, ps is probably printing what you would expect.
If your Unix flavour is Linux, I think pidstat (from the sysstat package) is better suited for your needs (not to mention, documented in a clearer way, in my opinion).