Home  >  Article  >  Backend Development  >  What is the inequality operator in php

What is the inequality operator in php

(*-*)浩
(*-*)浩Original
2019-09-06 09:58:007092browse

What is the inequality operator in php

PHP comparison operators are used to compare two values ​​​​(numbers or strings). Today we will introduce the inequality operator.

!=, not equal to operator, returns true if $x is not equal to $y. (Recommended learning: PHP video tutorial)

<!DOCTYPE html>
<html>
<body>

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

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

</body>
</html>

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

<!DOCTYPE html>
<html>
<body>

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

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

</body>
</html>

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

Statement:
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