Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Comparison operators in php

$check1 = 45;
$check2 = 45;
$check3 = 55;

if ($check1 == $check2){ //in this statment we check only variable values
    echo "both are equal";
    if ($check3>$check2){
        echo "Check 3 is greater than check2";
    }
}else{
    echo "Both are not equal";
}

echo "<br/>";
if (5 === 5.0){ //here we check both variable values and its data type
    echo "it is equal";
}else{
    echo "not equal";
}
Comment

Comparison Operators in php

$points = 10;

  $points++;
  $points++;
  $points++;

echo $points; // 13

  $points--;
  $points--;
  $points--;
  $points--;
  $points--;

echo $points; // 8;
Comment

PREVIOUS NEXT
Code Example
Php :: which song has the most curse words 
Php :: laravel notion require 
Php :: chunk in laravel 
Php :: print csv file in php 
Php :: pakistan standard time zone 
Php :: laravel controller and model create same file name 
Php :: php oops 
Php :: Primary Termlaravel recursive relationships 
Php :: join in php 
Php :: laravel model query time 
Php :: Call to a member function move() on null 
Php :: Adding another return message from Laravel Livewire 
Php :: how we generate a single column migration in laravel 
Php :: warning: parameter 2 to search_by_title() expected to be a reference, value given in 
Php :: bootstrap autocomplete example ajax php mysql 
Php :: register widget in wordpress 
Php :: accessing class in php 
Php :: updateorinsert laravel for large data 
Php :: verify that a valid login cookie was sent in order to do special things for that logged-in 
Php :: laravel add params form submission 
Php :: Laravel adimin - Form is editing or creating 
Php :: connexion sql php/html 
Php :: post with count greater than 1 laravel 
Php :: Metabox Array 
Php :: PHP SimpleXML - Get Node/Attribute Values 
Php :: date format in php 
Php :: php artisan make:auth is not working in laravel 8 
Php :: laravel create pivot migration 
Php :: laravel-filemanager not working 
Php :: Apache/2.4.52 (Win64) OpenSSL/1.1.1m PHP/7.4.27 Server at localhost Port 80 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =