Shiphp The PHP Developer's Guide to Docker

Latest Blog Posts

Introduction to Loops in PHP

In programming, we use loops to iterate over data. This can be useful for transforming individual elements in an array, validating input data, sorting, and many other things. PHP offers several methods for looping over data arrays. “for” Loops The for loop offers space for up to three parameters: the initial value, the condition, and the inc... Read more

Writing Functions in PHP

Functions are one of the basic building blocks of any programming language. They allow you to define blocks of code that can be called many times in many places throughout your program. Functions are great for reusability, but they also help make code more concise and easier to read. Let’s look at some examples. Using built-in PHP functions ... Read more

Writing a PHP Command Line Script

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

Working with Arrays in PHP

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

File Uploads in PHP

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