To write a PHP command line script, you will need PHP installed on your Mac, Windows, or Linux machine, a terminal command line tool like Bash, and a text editor like Sublime. To write a command line script in PHP, open up a new blank file your favorite text editor. Add an opening <?php tag to the very beginning of the new file. On ... Read more 09 Oct 2017 - less than 1 minute read
Arrays are widely used in PHP to store groups of data when an object or string will not suffice. Those familiar with other languages may equate PHP’s arrays to dictionaries, lists, collections, or stacks, but essentially a PHP array is a reliable key-value storage system in the language. Let’s look at what an array can do in practice. Creatin... Read more 09 Oct 2017 - 3 minute read
A common function for most web applications is uploading and storing files from users. Doing this securely and reliably can be a challenge, but there are a couple options if you’re using PHP. 1. Use a File Upload Service If you want to ensure that your file uploads are securely and reliably stored no matter what web hosting environment you u... Read more 09 Oct 2017 - 3 minute read
Many developers prefer strongly-typed languages, and critics have often dogged PHP because its weak typing opens users up to errors and vulnerabilities. While PHP is still a “weakly-typed” language (meaning variables can change types throughout the program’s lifecycle), PHP 7.0 sought to give developers more control over how they specify func... Read more 30 Aug 2017 - 3 minute read
If you’re familiar with the process for creating a simple website using PHP, then adding Docker to the mix should be relatively easy. The great thing about using Docker is that you have better portability over your code. Let’s look at a simple Docker command that will host a webpage written in PHP. Our PHP Script index.php Create a file cal... Read more 30 Aug 2017 - 2 minute read
If you’re used to running PHP command line applications, adding Docker could be a great way to increase the reusability and portability of your scripts. Docker allows you to run your code in isolated containers rather than on the host machine directly, meaning that even if you don’t have the same version of PHP or extensions installed, you can... Read more 30 Aug 2017 - 2 minute read
We are excited to announce the release of our first eBook, Building PHP Applications in Docker: A Step By Step Guide for PHP Developers Learning Docker. The book covers a wide range of topics including: Installing dependencies using Composer. Getting data from a third-party API. Saving data to a database. Using a web framework for rout... Read more 20 Aug 2017 - less than 1 minute read