In PHP, all command line arguments, including the script name itself are stored in a special array named $argv. The first element, zero, is the name of the script being run. For example:
SSL sockets are perfect for sending secure data. With certificates, you can verify the identify of the host, the client, or both. Signed certificates cost money but you can create and self-sign a certificate. Check out the code samples below to see how to generate SSL certificates and create SSL clients and servers. Examples include raw socket communication as well as the common HTTPS protocol.
With PHP, creating a TCP server takes only a few lines of code. Check out this code that creates a server which responds with the current time.
PHP has a built in web server that was introduced in version 5.4.0. It is not suited for production but is great for easy development or quick testing. Here are a few ways to use it.
Two common libraries for image manipulation with PHP are GD and Imagick. GD typically comes with most PHP setups. Here are some code snippets that demonstrate how to crop an image with both libraries.
Without proper care, developers can leave their CakePHP website open to cross-site scripting attacks. Controllers using scaffold functions do not take care to sanitize data, and leaves the website vulnerable. When using the bake tool in the console, it generates controllers as simple as the scaffold version. Some suggest storing the unsanitized data and escape the dangerous characters on output. In a perfect world I would agree with this approach, but it is easy to forget to sanitize output every time, or for an amateur developer to be ignorant of the dangers.