Variable types CODE
String
$name = "George";
Integer
$weight = 85; //kg
Float
$height = 1.9; //m
Boolean
$male = true;
Array
$colors = ["Red", "Green", "Blue"];
// Instead of storing them in separate variables like this:
$color1 = "Red";
$color2 = "Green";
$color3 = "Blue";
gettype()
returns a type of a given variable
echo gettype($my_name); // string
by Valeri Tandilashvili
2 years ago
PHP
Variables
6
Pro tip: use ```triple backticks around text``` to write in code fences