Creating Variables with PHP, Learning to Write PHP Variables, Understand Variables in PHP Codecademy

In this PHP lesson, we take a look at Creating Variables with PHP, Learning to Write PHP Variables, Understand Variables in PHP Codecademy. In it, we learn the syntax for creating a PHP variable. In order to create a variable in PHP, we need to start the variable name with a dollar sign ($). Using the dollar sign allows our program to quickly know that we are dealing with a variable. Once our program sees the variable, it will quickly replace the variable with the value that is held in memory. Practice writing variables in PHP and create different types of variables to truly understand how creating variables works in PHP. Learning to master PHP will start with you understanding PHP variables, and after mastering this step, your next step will be learning the rest of the PHP syntax. Make sure to practice understanding PHP variables to truly master the language. When we want to assign a value to a variable we use the equal sign (also called the assignment operator). On the left side of the assignment operator, we have the variable name. On the right side of the equal sign, we place the value we want our variable to hold. Make sure to master writing and creating your own PHP variables before moving on to the next lesson!