What are comparison operators in php

(*-*)浩
Release: 2023-02-23 20:12:01
Original
6924 people have browsed it

php comparison operator, which allows comparison of two values.

What are comparison operators in php

Comparison operators, as their name implies, allow two values ​​to be compared. You can also refer to the PHP type comparison table for examples of how different types compare to each other. (Recommended learning: PHP Programming from Beginner to Master)

What are comparison operators in php

The following example shows different results of using certain comparison operators:

Example

<?php
$x=17; 
$y="17";

var_dump($x == $y);
echo "<br>";
var_dump($x === $y);
echo "<br>";
var_dump($x != $y);
echo "<br>";
var_dump($x !== $y);
echo "<br>";

$a=17;
$b=8;

var_dump($a > $b);
echo "<br>";
var_dump($a < $b);
?>
Copy after login

The above is the detailed content of What are comparison operators in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!