Core Function BinaryLen
From Sputnik Wiki
BinaryLen( <binary-array> )
Contents |
Description
Returns the number of bytes in a binary variable.
Parameters
binary-array
The binary variable to evaluate.
Return Value
Success: Returns the length of the binary data in bytes.
Failure: Returns -1.
Remarks
UBound works just as good for this.
Example
$binary = BinaryHex("48656c6c6f20576f726c6421"); println( "Binary HEX: '" . BinaryStr($binary, ",") . "'" ); println("The binary size is: " . BinaryLen($binary) ); Foreach ($binary as $i) { println( "Byte: " . $i . " | Hex: " . Hex($i) . " | Char: " . Chr($i) ); } $String = Unpack("A*", $binary, 3); println("Full string: " . $String);