The difference between && and & operations in php

不言
Release: 2023-03-23 12:28:01
Original
3989 people have browsed it

本篇文章给大家分享的是关于php中&&与&运算的区别 ,有需要的朋友可以参考一下
&&是逻辑运算”与“,参加运算的两个量理解为逻辑值TRUE、FALSE在进行运算,两个值都为TRUE时结果为TRUE,否则结果为FALSE,例如:3 && 5的结果为TRUE。

&是数学运算”按位与“,参加运算的两个数的二进制形式,每一个二进制位进行”与“运算,最后的结果二进制作为结果,例如:3 & 5=1,因为3和5的二进制分别是0011、0101,两个进行与运算的结果是0001。
Copy after login

               

The above is the detailed content of The difference between && and & operations 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!