Learn PHP Data Type
For instance , There is one employee in office his name is Akshay Dhiman and his salary is $2000. Lets see how we represent the employee in PHP script:
$employee_name = 'Akshay Dhiman';
$employee_salary = 2000;
Now in this script ,there is two data types $employee_name and $employee_salary .
$employee_name = String
This also matter when you used in expressions and operations . See in this example , the gender title is added into employee name and salery is increased using extra value .
$employee_name = 'Mr '.$employee_name;
$employee_salary = $employee_salary +200;
Basically PHP data type is used to carry different type of values and data .PHP supports ten primitive types which are categorized in these 3 steps:
Scalar ,Compound ,Special
Float (floating-point number, aka double)