Home > Backend Development > PHP Tutorial > PHP XOR Operator_PHP Tutorial

PHP XOR Operator_PHP Tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 17:53:07
Original
2031 people have browsed it

Or operator, & exclusive operator. When writing code, I always forget to write $, which makes me think I wrote it wrong
[php]
$i=0;
$i=i|1;
echo "$i";// Explain the difference between "" double quotation marks and '' single quotation marks: double quotation marks will output the value inside, such as the value of $i, 1. If single quotation marks are used, the string $i will be output directly
echo "
";
echo $i|=2;
echo "
";
//echo $i|=4;
echo "
";
echo $i|=8;
echo "
";
echo $i&1;
echo "
";
echo $i&2;
echo "
";
echo $i&4;
echo "
";
echo $i&8;
The output result is:
[php]
1
3

11
1
2
0
8

At this time $i&4 is less than 0

Author: Android_Xiaoqi

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478074.htmlTechArticleOr operator, exclusive operator. I always forget to write $ when writing code, so I think I wrote it wrong [php] $i=0; $i=i|1; echo $i;// Explain the difference between double quotes and single quotes: Double quotes Will output...
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template