Home > Backend Development > PHP Problem > What are the inequality operators in php?

What are the inequality operators in php?

青灯夜游
Release: 2023-02-27 13:54:01
Original
7693 people have browsed it

What are the inequality operators in php?

The inequality operators in php include: != and <>. They are all PHP comparison operators, used to compare two values ​​and return true if one value is not equal to the other value.

!=, not equal to operator, returns true if $x is not equal to $y.

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

var_dump($x != $y); // 返回 false,因为值相等
?>
Copy after login

<>, not equal to operator, returns true if $x is not equal to $y.

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

var_dump($x <> $y); // 返回 false,因为值相等
?>
Copy after login

For more PHP related knowledge, please visit php中文网!

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

Related labels:
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