Results: 1024
::after, ::before, ::first-letter, ::first-line
CSS3 introduced these notations (with two colons) to distinguish pseudo-classes from pseudo-elements. Browsers also accept
:after
,
:before
,
:first-letter
,
:first-line
, introduced in CSS2
npm install package@latest
Installs the latest version of the package
npm install package  /  npm install package@latest
PHP Variables CODE
Different types of Variables
$name = "George";
$age = 25;
$weight = 75; //kg
$height = 1.85; //m
Variables used in expressions
echo "His name is ".$name."\n";
echo "He is ".$age." years old\n";
echo "He weighs around ".$weight."\n";
echo "he is ".$height."m tall \n";
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
Rules to create PHP variable CODE
- A variable starts with the
$
sign, followed by the name of the variable - A variable name must start with a letter or the underscore character - A variable name cannot start with a
number
- A variable name can only contain alpha-numeric characters and underscores (
A-z
,
0-9
, and
_
)
// Correct Syntax
$variable_name = "Value";

// Incorrect Syntax
Variable_Name = "Value";
$5variable_name = "Value";
$variable-name = "Value";
set timezone to Asia/Tbilisi (+4)
Sets
timezone
using
php.ini
file
date.timezone = Asia/Tbilisi
Sets
timezone
inside php script file
ini_set('date.timezone', 'Asia/Tbilisi');
Arithmetic operators work with:
integer
and
float
values to perform arithmetical operations. Let's define two variables:
number1
and
number2
and perform these operations
$number1 = 40;
$number2 = 9;
Addition
echo $number1 + $number2 . "\n";
Subtraction
echo $number1 - $number2 . "\n";
Multiplication
echo $number1 * $number2 . "\n";
Division
echo $number1 / $number2 . "\n";
Modulus
echo $number1 % $number2 . "\n";
echo statement CODE
Prints plain text
echo 'plain text'."\n";
Double quotes can parse variables
echo "Double quotes: $text"."\n";
Single quotes can not parse variables
echo 'Single quotes: $text'."\n";
Single quotes as well as double quotes can be concatenated with variables
echo 'Single quotes - '.$text." - Double quotes"."\n";
Text inside Single quotes can include double quotes as part of the text
echo 'The text includes "double" quotes as part of the text'."\n";
Text inside double quotes can include single quotes as part of the text
echo "Jane's surname is Smith"."\n";
echo can be used as a function
echo ('echo as a function')."\n";
echo can print number without quotes
echo 5 . $number;
echo
can take multiple parameters
echo 'one', 'two', 'three', "\n";
We can print multiple lines of text
echo 'Prints text 
    with multiple
lines';
PHP Comments CODE
Single line comment
// $variable = 'Value';
Another single line comment
# $variable = 'Value';
Comment for multiple lines
/*$variable = 'Value';
$second_variable = 'Value 2';
$third_variable = 'Value 3';*/
Inline comment
$number = 5 /* - 5  */ + 5;
Hello world CODE
Prints the text
Hello world
echo "Hello world";
Prints the two words one by one
echo "Hello ";
echo "world";
Prints the variable
$greeting
$greeting = "Hello world";
Echo $greeting;
Concatenates the string to the variable
$greeting
$greeting = "hello world!";
Echo $greeting . " Let's get started!";
Results: 1024