Need help with part of PHP code!

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
Malyghos
Forum Newbie
Posts: 1
Joined: Thu Dec 23, 2010 3:45 am

Need help with part of PHP code!

Post by Malyghos »

Hello,
I have one line that I can't understand of PHP code used to encrypt strings:

Code: Select all

$temp = ord(substr($str,$i,1)) ^ 203;
I understand everything but this " ^203 "
Can you explain me what it does?
cpetercarter
Forum Contributor
Posts: 474
Joined: Sat Jul 25, 2009 2:00 am

Re: Need help with part of PHP code!

Post by cpetercarter »

^ is the bitwise XOR operator. In your example $temp will be a value in which bits are set IF they are set in the expression ord(substr($str,$i,1)) OR in the integer 203 BUT NOT in both.
Post Reply