- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the significance of ‘^’ in PHP?
The ‘^’ is a bitwise operator in PHP, i.e XOR (exclusive OR) bitwise operator, that is used to display the ASCII values of variables in question. For example − For evert bit in the value, the ^ operator checks if that bit is the same in the other value too. If the values are same, 0 is produced as an output, otherwise 1 is shown as output. Below is an example illustrating the same −
Example
<?php $x = "a"; $y = "b"; $x ^= $y; $y ^= $x; $x ^= $y; echo $x; echo "
"; echo $y; ?>
Output
b a
Different variables are assigned character values and the ‘^’ operator is used to perform XOR on the two variables. Relevant output is displayed on the console.
- Related Articles
- what is the significance of finally in javascript?
- What is the significance of Charminar in Hyderabad?
- What is the significance of Hampi Monuments?
- What is the significance of Ajanta Caves?
- What is the significance of Bodh Gaya?
- What is the significance of Taj Mahal?
- What is the significance of Ellora Caves?
- What is the significance of Elephanta Caves?
- What is the significance of Qutub Minar?
- What is the significance of Red Fort?
- What is the significance of Western Ghats?
- What is the significance of emulsification of fats?
- What is the significance of the Khajuraho Monuments?
- What is the significance of "bindi" in Indian Culture?
- What is the significance of Nanda Devi in Uttarakhand?

Advertisements