Operator     Name	 Example	          Result
  and	      And	$x and $y	True if both $x and $y are true	
  or          Or	$x or $y	True if either $x or $y is true	
  xor	      Xor	$x xor $y	True if either $x or $y is true, but not both	
  &&	      And	$x && $y	True if both $x and $y are true	
  ||	      Or	$x || $y	True if either $x or $y is true	
  !	      Not	!$x	        True if $x is not true$x = 10;
$y = -10;
// Operator - and
if ( $x > 5 and $y > -15 ) {
	echo "True: $x > 5"."\n";
	echo "True: $y > -15"."\n\n";
}
// Operator - or
if ( $x > 100 or $x > -1 ) {
	echo "False: $x > 100"."\n";
	echo "True: $x > -1"."\n\n";
}
// Operator - xor
if ($x == 10 xor $y == -10 ) {
	// both conditional statements are true! 
} else {
	echo "Both is true \n\n";
}
// Operator - && (same as - and)
if ($y <= 0 && $y == -10 and $y != 10) {
	echo "True: $y <= 0\n";
	echo "True: $y = -10\n";
	echo "True: $y != 10\n\n";
}
// Operator - || (same as - or)
if ($x == 1 or $x == 10){
	echo "True: $x = 10\n";
	echo "False: $x = 1\n\n";
}
$x = 0;
// Operator - !
if (!$x) {
	echo "$x is false";
}
function
 functionName() {
  code to be executed;
}
functionName() // Calling a functionfunction printMyName() {
	echo "My name is Levani :))\n";
}
printMyName(); // calling a function// Function with parameters
function printInfo($firstName,$lastName,$age){
	echo "Hello,my name is $firstName $lastName, I am $age years old :))\n";
}
// Arguments
printInfo("Levani","Makhareishvili",19);
$name = "Mads";
$lastName = "Mikkelsen";
$age = 56;
printInfo($name,$lastName,$age);while (condition is true) {
   code to be executed;
}// outputs the numbers from 1 to 10
$x = 1;
while($x <= 10) {
  echo "The number is: $x \n";
  $x++;
}
// $x = 1; - Initialize the loop counter ($x), and set the start value to 1
// $x <= 10 - Continue the loop as long as $x is less than or equal to 5
/* $x++; - Increase the loop counter value by 1 for each iteration.
Otherwise, the condition always will be true and the loop will run endlessly*/do {
  code to be executed;
} while (condition is true);$x = 1;
do {
  echo "The number is: $x \n";
  $x++;
} while ($x <= 2);
/* outputs    The number is: 1
              The number is: 2 */
              
$x = 10;
do {
  echo "The number is: $x \n";
  $x++;
} while ($x <= 2);
// outputs   The number is: 10for (init counter; test counter; increment counter) {
  code to be executed for each iteration;
}// outputs the numbers from 1 to 10
for ($i = 0; $i <= 10; $i++) {
  echo "The number is: $i \n";
} 
// Without first parameter
$i = 0;
for (; $i <= 10; $i++) {
  echo "The number is: $i \n";
} // outputs the numbers from 1 to 10
// Without first and third parameter
$i = 0;
for (; $i <= 10;) {
  echo "The number is: $i \n";
  $i++; // we got the while loop syntax :))
} // outputs the numbers from 1 to 10
// We can make a for loop infinite without using these three parameters
for ( ; ; ){
	echo "infinite \n";
}foreach ($array as $value) {
  code to be executed;
}// array - $country
$country = ["Georia","Ukraine","Spain"];
foreach ($country as $value) { // Instead of name $value we can write any name
  echo "$value \n";
}
/* outputs:    Georia 
	       Ukraine 
               Spain 
 */
 
 // array - numbers
 $numbers = array("one" => 1 , "two" => 2 , "three" => 3 );
foreach($numbers as $n => $value) {
  echo "$n = $value \n";
}
/*outputs:   one = 1
             two = 2
             three = 3
*/
// also, we can print only keys/values
foreach($numbers as $n => $value){
	echo "$n \n"; // if we need value of key, we must whrite $value
}                 // keys are "one","two","three" and values are 1,2,3
/*outputs:   one
	     two
	     three
*/