?>For example, you have the character "ñ" encoded like this "%C3%B1". This is nothing more and nothing less than 0xc3 and 0xb1, they are binary numbers, (HHHH LLLL, where HHHH=High and LLLL=Low).0xc3 = 1100 0011 (binary 8 bit word), 0xb1 = 1011 0001 (binary 8 bit word),To convert a raw encoded character to ascii we have to make boolean operationsbetween this two operands (0xc3 and 0xb1), boolean algebra were defined by George Boole, we need to use them here. The first one we going to use is the logical OR ("|" or "pipe") and logical AND ("&" or "and person").

A logical OR implies the following truth table:a b (a OR b)0 0 00 1 1 (a OR b or Both, a and b, must be true to get a true result)1 0 11 1 1

A logical AND implies the following truth table:a b (a AND b)0 0 00 1 0 1 0 01 1 1 (Both a AND b, must be true to get a true result)

So, here we have to make a logical OR with both 0xc3 and 0xb1 HIGH nibble,a nibble is a half byte (4 bits), so we have to make a logical OR between 1100 (0xc) and 1011 (0xb), we going to get this: 1111 (0xf), then we have to makea logical AND between both LOW nibble, 0011 (0x3) and 0001 (0x1), we going to get this: 0001, so, if we want to see the final result, we have to put HIGH and LOW nibble on his Byte position, like this: 1111 0001 (0xf1) and that is nothing more and nothing less than "ñ" (to check this out, try the following: print(chr(0xf1));).

This "<<" is a logical shift left, if we have this binary number 0001 (1) and we make this:0001 << 2 we'll get 0100 (4) right bits are filled with 0's.

Be aware that rawurldecode does not warn you in any way if the output is nonvalid UTF-8.For example if the input passed to the function is just "%C5", then since C is 1100 in binary, and UTF-8 characters starting with 110 should be followed by another character, the result of rawurldecode will be just a single byte (with value \xC5) which is not a correct UTF-8.Confront this with for example Javascript which will warn you about it:

?>For example, you have the character "ñ" encoded like this "%C3%B1". This is nothing more and nothing less than 0xc3 and 0xb1, they are binary numbers, (HHHH LLLL, where HHHH=High and LLLL=Low).0xc3 = 1100 0011 (binary 8 bit word), 0xb1 = 1011 0001 (binary 8 bit word),To convert a raw encoded character to ascii we have to make boolean operationsbetween this two operands (0xc3 and 0xb1), boolean algebra were defined by George Boole, we need to use them here. The first one we going to use is the logical OR ("|" or "pipe") and logical AND ("&" or "and person").

A logical OR implies the following truth table:a b (a OR b)0 0 00 1 1 (a OR b or Both, a and b, must be true to get a true result)1 0 11 1 1

A logical AND implies the following truth table:a b (a AND b)0 0 00 1 0 1 0 01 1 1 (Both a AND b, must be true to get a true result)

So, here we have to make a logical OR with both 0xc3 and 0xb1 HIGH nibble,a nibble is a half byte (4 bits), so we have to make a logical OR between 1100 (0xc) and 1011 (0xb), we going to get this: 1111 (0xf), then we have to makea logical AND between both LOW nibble, 0011 (0x3) and 0001 (0x1), we going to get this: 0001, so, if we want to see the final result, we have to put HIGH and LOW nibble on his Byte position, like this: 1111 0001 (0xf1) and that is nothing more and nothing less than "ñ" (to check this out, try the following: print(chr(0xf1));).

This "<<" is a logical shift left, if we have this binary number 0001 (1) and we make this:0001 << 2 we'll get 0100 (4) right bits are filled with 0's.

Let's say you pass some data between the client and the server in a more or less array-like structure.

If using the [] brackets in the field names is not enough (or won't comply with the rest of the project for some reason), you might have to use a string with a number of different delimiters (rows, fields, rows inside fields and such).

To make sure that the data doesn't get mistaken for delimiters, you can use the encodeURIComponent() JavaScript function. It pairs nicely with rawurldecode().

Once the string passed to the server side finally gets exploded into an array (or set of such), you could use the following function to recursively rawurldecode the array(s):