Shiphp The PHP Developer's Guide to Docker

Latest Blog Posts

Making Your First Website with PHP

In order to build a working website on your computer that is powered by PHP, you’ll need to first have PHP installed and know some basic HTML. In this tutorial we will make a website that displays variables written in PHP code to users in an HTML document. Let’s get started! Open a text editor and create a file called index.html Add the ... Read more

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