Thread: & and `
View Single Post
Old 04-18-2009, 01:25 PM   #3 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

The & is a 'bitwise and' operator and is used in doing arithmetic on binary. For the example that you gave 'a' is binary 01100001 and 'b' is binary 01100010. The & means to set the result's bits to 1 where it is set in both, and to 0 otherwise. So the result is 01100000. Now, the echo statement converts the result to a string and the ASCII character for 01100000 (decimal number 96) is the backtick (`) character.
Salathe is offline  
Reply With Quote