1. Variables - some containers that contain information.
- whole numbers
- floating point numbers
- boolean type (Boolean) - it has only two values - true or false
$i //variable i
$c //variable c
//It is forbidden to set a variable starting with a number
/* It's best to name variables with a letter or an underscore, but it's better to start with a letter and you won't have any problems.*/
$var = 1 ; // variable var is assigned 1, sign ; - means completion of the operation.
$int = 1 ; // integer - an integer
$string = 'string' ; //string variables
$float = 185.658412 ; // float - floating point numbers
$bool = false ; $bool2 = true ; //Boolean - boolean data type
//to display variables or html tags in the browser window, use echo
'; // outputs a line break
2. Introduction to classes - a class can be compared to an encyclopedic article, there is a type of objects and it can be described using classes. What a class can describe: the parameters of objects (what the class physically has) and their capabilities (what it can do).
//the class can have variables, which the class has
// class body
var $color = 'red';
var $speed = 'fast';
$bmw = new Car() ; //create an instance of the Car type, an object of the Car class
'; // Derive the class property from the object
$bmw->speed = 'slow' ; //Change the class property speed to slow
echo $bmw->speed ; // Derive the class property from the object