Summary

In this hour, you learned how to communicate with the shell and through it with external applications. PHP is a powerful language, but it sometimes is faster to call on an application than it is to create similar functionality yourself.

You learned how to pipe data to and from a command using the popen() function. This approach is useful for applications that accept data on standard input and when you want to parse data as it is sent to you by an application.

You learned how to use exec(), system(), and the backtick operator to pass commands to the shell and to acquire user input. You learned about the dangers of passing user input to the shell and examined the escapeshellcmd() function, which will afford you some protection from malicious ...

Get Sams Teach Yourself PHP in 24 Hours, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.