Yeah, if you want to simply echo the result directly on the screen use system(), eg system('ls -l') will echo the directory the script is running in.
alternatively if you want the last line of the command as a result you can declare as a variable use $variablename = exec('ls -l') or what ever your command is. There are a few more functions that work really cool, one of them puts each line into an array i think, but i have never used it.