in reply to I'm looking for the faster way to convert char 2 Bin and Bin 2 char (8bits)

To get the byte (char) representation of a bit string:
$char = pack("b8","01010101");
To get the bit_string of a char/byte:
$bit_string = unpack("b8",$char);
  • Comment on Re: I'm looking for the faster way to convert char 2 Bin and Bin 2 char (8bits)

Replies are listed 'Best First'.
Re: Re: I'm looking for the faster way to convert char 2 Bin and Bin 2 char (8bits)
by DarkGoth (Acolyte) on Jan 26, 2001 at 13:25 UTC
    Thanx, that was exactly what i looked for ;)~~~~