I'm making a program to show who is logged into a server which I manage - I'm using a very simple PHP script with a shell_exec() executing the "users" command at a prompt.
As you may or may not know, the output from users is a list like this:
mberman root jschmoe bsmith
What I want to do is to remove any root entries from the output before it is displayed - so users won't know if root is logged in using this interface.
The above output should read,
mberman jschmoe bsmith
I'm not sure how to have php seek and eliminate any instances of "root" in a variable. Is this terribly complicated to do?