You can buy the eBook on Leanpub or sign up to get a coupon code to download it for FREE!
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 09 Oct 2017 - 1 minute read
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 09 Oct 2017 - 2 minute read
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 09 Oct 2017 - 2 minute read
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