Get the App
SLTechnology News&Howtos  ›  Development  › 

How to easily master the syntax and usage techniques of PHP logical operators

Shulou Source: shulou.com Published: 2022-06-03 04:24:44 09月26日 Update

This article is about how to easily master PHP logic operator syntax and the use of technology, the editor feels very practical, so share with you to learn, I hope you can learn something after reading this article, say no more, follow the editor to have a look.

PHP has a lot to learn. Here we mainly introduce PHP logical operators, including bit operators, comparison operators, and so on. The bit operator allows you to set the bits specified in the integer. If both the left and right arguments are strings, the bit operator will manipulate the characters in the string.

Bit operator of 1.PHP logical operator:

&: $a & $b And (bitwise and) sets the bit that is 1 in both $an and $b to 1. |: $a | $b Or (bitwise or) sets the bit 1 in $an or $b to 1. ^: $a ^ $b Xor (bitwise XOR) sets the different bits in $an and $b to 1. ~: $a Not (bitwise non) sets the 0 bit in $a to 1, and vice versa.

Tags: Operations operators logic errors binaries characters knowledge expressions techniques syntax code examples information variables strings numeric values aspects more articles types Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Shulou Technology MariaDB NVidia macOS