what is ^ symbol

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
global_erp_solution
Forum Commoner
Posts: 25
Joined: Sun Jul 08, 2012 6:47 am

what is ^ symbol

Post by global_erp_solution »

I encountered this code:

Code: Select all

$x^=$y
what operation is this? I've searched in php manual, but couldn't find it. thanks
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: what is ^ symbol

Post by social_experiment »

I found two 'uses' for the caret (^) in the book i have about php
1. used with money_format()
2. used in regular expressions to negate characters / character classes
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: what is ^ symbol

Post by requinix »

global_erp_solution
Forum Commoner
Posts: 25
Joined: Sun Jul 08, 2012 6:47 am

Re: what is ^ symbol

Post by global_erp_solution »

yes, XOR seems right. thanks
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: what is ^ symbol

Post by social_experiment »

Interesting. Something new to look into
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Post Reply