For example, in PHP, how would I reverse the bits of the byte 11011111 to 11111011?
11011111
11111011
If you have already the bits in the form of a string, use strrev.
If not, convert first the byte to its binary representation by using decbin, then reverse using strrev, then go back to byte (if necessary) by using bindec.