getid3_lib::PrintHexBytes()
{} It's a method of the class: getid3_lib{}
No Hooks.
Return
String
.
Usage
$result = getid3_lib::PrintHexBytes( $string, $hex, $spaces, $htmlencoding );
- $string(string) (required)
- -
- $hex(true|false)
- -
Default: true - $spaces(true|false)
- -
Default: true - $htmlencoding(string|true|false)
- -
Default: 'UTF-8'
Code of getid3_lib::PrintHexBytes() getid3 lib::PrintHexBytes WP 6.0
public static function PrintHexBytes($string, $hex=true, $spaces=true, $htmlencoding='UTF-8') { $returnstring = ''; for ($i = 0; $i < strlen($string); $i++) { if ($hex) { $returnstring .= str_pad(dechex(ord($string[$i])), 2, '0', STR_PAD_LEFT); } else { $returnstring .= ' '.(preg_match("#[\x20-\x7E]#", $string[$i]) ? $string[$i] : '¤'); } if ($spaces) { $returnstring .= ' '; } } if (!empty($htmlencoding)) { if ($htmlencoding === true) { $htmlencoding = 'UTF-8'; // prior to getID3 v1.9.0 the function's 4th parameter was boolean } $returnstring = htmlentities($returnstring, ENT_QUOTES, $htmlencoding); } return $returnstring; }