• String
$str = "string"; // "hello" "Gamarjoba" 'levani' and so on.
• Integer
$int_num = 10; // -12 400 9999 -123421 90 and so on.
• Float
$float_num = 2.5; // -1.5 20.5 150.7 and so on.
• Boolean
$human = true; // equals 1
$robot = false; // equals 0
• Array
$laptops = array("Dell","Lenovo","Hp",1,2,3);
• constant Constants are similar to variables except that they cannot be changed or undefined after they've been defined. Begin the name of your constant with a letter or an underscore. To create a constant, use the define() function. (no $ sign before the constant name): • name: Specifies the name of the constant • value: Specifies the value of the constant • case-insensitive: Specifies whether the constant name should be case-insensitive. Default is false
define(name, value, case-insensitive)
// define constant
define("PI",3.141592);
echo PI;
I will discuss additional data types later, in a new note!
by Levani Makhareishvili
2 years ago
PHP
variables
1
Pro tip: use ```triple backticks around text``` to write in code fences