
Variable what?
A variable is something that is used in a formula or algebra. For example, x = 2. What does that make this equation? 3x + 2 = ? In the example it's 8. The same thing applies in PHP or any kind of coding work. It's a pre-defined bit of information that you can use in the rest of your code.
So how do you define a variable?
PHP recognises $variable_name as a variable. It has to have the dollar sign there to make it a variable. But this example has no value.. Here's how it would look...
$variable_name = "hi im the value of the variable";
Now, wherever you put $variable_name in your code, the text "hi im the value of the variable". Of course you would have to echo or print the variable to make this text display on a page.