src/PelConvert.php
public static function bytesToDump($bytes, $max = 0)
    {
        $s = strlen($bytes);

        if ($max > 0) {
            $s = min($max, $s);
        }
        $line = 24;

        for ($i = 0; $i < $s; $i ++) {
            printf('%02X ', ord($bytes{$i}));

            if (($i + 1) % $line == 0) {
                print("\n");
            }
        }
        print("\n");
    }
public static function bytesToDump($bytes, $max = 0)
    {
        $s = strlen($bytes);

        if ($max > 0) {
            $s = min($max, $s);
        }
        $line = 24;

        for ($i = 0; $i < $s; $i ++) {
            printf('%02X ', ord($bytes{$i}));

            if (($i + 1) % $line == 0) {
                print("\n");
            }
        }
        print("\n");
    }
public static function bytesToDump ( $ bytes , $ max = 0 ) { $ s = strlen ( $ bytes ) ; if ( $ max > 0 ) { $ s = min ( $ max , $ s ) ; } $ line = 24 ; for ( $ i = 0 ; $ i < $ s ; $ i ++ ) { printf ( '%02X ' , ord ( $ bytes { $ i } ) ) ; if ( ( $ i + 1 ) % $ line == 0 ) { print ( "\n" ) ; } } print ( "\n" ) ; }
Format bytes for dumping.

This method is for debug output, it will format a string as a
hexadecimal dump suitable for display on a terminal. The output
is printed directly to standard out.

@param string $bytes
the bytes that will be dumped.

@param integer $max
the maximum number of bytes to dump. If this is left
out (or left to the default of 0), then the entire string will be
dumped.
@return void
Format bytes for dumping .