Integers. You mean math? The integer data type represents whole numbers, either positive or negative or zero, not fractions. Before we get into anything worth looking at, let’s look at a simple example. Create a new PHP file and copy the following code into it.   <?php $x = 0; $y = 1; $z = -2; echo $x + $y + $z; ?>   You should get a -1 as the result. I know that we haven’t looked at arithmetic operators, but I’m sure that you can figure out what the + operator does in the previous example. We set

What Do You Mean Truthy? We looked at boolean values in the previous article. Booleans represent true or false. PHP Truthy Booleans, which are values that are not true or false, but when evaluated inside an expression, they can act like they are. The best examples are the integers 0 and 1. If we passed 1 to the if statement, PHP would interpret the number 1 as truthy and would execute the statement inside the body. If you pass 0 to the if statement, PHP would interpret 0 as falsy, so it would not execute the statement inside the if

True or False? The PHP boolean value is a scalar data type that represents the values true and false. That’s really it. End of article. That would be a short article so lets take a look at a few examples before we abruptly end it. Create a new file and name it booleans_intro.php. We’ll be testing out the code below with our booleans_intro.php file. One of my favorite vehicles, and this is important for understanding booleans properly, is the MKIV 2JZGTE Toyota Supra. We’ll create a variable to check whether that Supra currently exists in my garage or not.  

Can you even store data? The best way to introduce PHP variables is to start thinking about math. You might remember that there are these things called x and y variables that used to store numbers. If x = 2 and y = 5 then what is x + y? Just substitute 2 for x and 5 for y and you get 7. Variables are just storage containers. You can store any data type that you would like inside of them; we’ll look at strings and integers below. In PHP, variables start with a dollar sign, followed by either the

Should you document your code? PHP has a few different options when it comes to comments. Frequently, it’s based on preference on which comment style you use, but other times it makes sense to use one over the other. PHP Comments allow you to write brief or detailed descriptions explaining what the code that you wrote actually does. You, or someone else, will come back to your code years from now and will try to decipher what it actually means. You should always strive to write code that’s self-explanatory, but every once in while, you may want to specify a

Where to Begin? Lets Start With PHP Basic Syntax. PHP is leaps and bounds above where it started. It’s a modern programming language that has Object Oriented capabilities. It’s the backbone of popular frameworks like Laravel. It’s great for the web and it makes writing web-based applications enjoyable. It can be used to produce both full-stack and back-end applications. With back-end applications, you have a choice for your front-end library or framework. With the Laravel backend framework, front end libraries like React or Vue tie in nicely. I still see countless arguments against PHP, so I finally had enough. I’m going to show you how