getid3_lib
- Source
wp-includes/ID3/getid3.lib.php:27
Compatibility
- WordPress
- core
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Methods · 71
- PrintHexBytes()
- trunc()Truncates a floating-point number at the decimal point.
- safe_inc()
- CastAsInt()
- intValueSupported()
- SafeDiv()Perform a division, guarding against division by zero
- DecimalizeFraction()
- DecimalBinary2Float()
- NormalizeBinaryPoint()
- Float2BinaryDecimal()
- Float2String()
- LittleEndian2Float()
- BigEndian2Float()ANSI/IEEE Standard 754-1985, Standard for Binary Floating Point Arithmetic
- BigEndian2Int()
- LittleEndian2Int()
- LittleEndian2Bin()
- BigEndian2Bin()
- BigEndian2String()
- Dec2Bin()
- Bin2Dec()
- Bin2String()
- LittleEndian2String()
- array_merge_clobber()
- array_merge_noclobber()
- flipped_array_merge_noclobber()
- ksort_recursive()
- fileextension()
- PlaytimeString()
- DateMac2Unix()
- FixedPoint8_8()
- FixedPoint16_16()
- FixedPoint2_30()
- CreateDeepArray()
- array_max()
- array_min()
- XML2array()
- SimpleXMLelement2array()
- hash_data()Returns checksum for a file from starting position to absolute end position.
- CopyFileParts()
- iconv_fallback_int_utf8()
- iconv_fallback_iso88591_utf8()ISO-8859-1 => UTF-8
- iconv_fallback_iso88591_utf16be()ISO-8859-1 => UTF-16BE
- iconv_fallback_iso88591_utf16le()ISO-8859-1 => UTF-16LE
- iconv_fallback_iso88591_utf16()ISO-8859-1 => UTF-16LE (BOM)
- iconv_fallback_utf8_iso88591()UTF-8 => ISO-8859-1
- iconv_fallback_utf8_utf16be()UTF-8 => UTF-16BE
- iconv_fallback_utf8_utf16le()UTF-8 => UTF-16LE
- iconv_fallback_utf8_utf16()UTF-8 => UTF-16LE (BOM)
- iconv_fallback_utf16be_utf8()UTF-16BE => UTF-8
- iconv_fallback_utf16le_utf8()UTF-16LE => UTF-8
- iconv_fallback_utf16be_iso88591()UTF-16BE => ISO-8859-1
- iconv_fallback_utf16le_iso88591()UTF-16LE => ISO-8859-1
- iconv_fallback_utf16_iso88591()UTF-16 (BOM) => ISO-8859-1
- iconv_fallback_utf16_utf8()UTF-16 (BOM) => UTF-8
- iconv_fallback()
- recursiveMultiByteCharString2HTML()
- MultiByteCharString2HTML()
- RGADnameLookup()
- RGADoriginatorLookup()
- RGADadjustmentLookup()
- RGADgainString()
- RGADamplitude2dB()
- GetDataImageSize()
- ImageExtFromMime()
- CopyTagsToComments()
- EmbeddedLookup()
- IncludeDependency()
- trimNullByte()
- getFileSizeSyscall()
- truepath()
- mb_basename()Workaround for Bug #37268 (https://bugs.php.net/bug.php?id=37268)
Source code
class getid3_lib{ /** * @param string $string * @param bool $hex * @param bool $spaces * @param string|bool $htmlencoding * * @return string */ 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; } /** * Truncates a floating-point number at the decimal point. * * @param float $floatnumber * * @return float|int returns int (if possible, otherwise float) */ public static function trunc($floatnumber) { if ($floatnumber >= 1) { $truncatednumber = floor($floatnumber); } elseif ($floatnumber <= -1) { $truncatednumber = ceil($floatnumber); } else { $truncatednumber = 0; } if (self::intValueSupported($truncatednumber)) { $truncatednumber = (int) $truncatednumber; } return $truncatednumber; } /** * @param int|null $variable * @param-out int $variable * @param int $increment * * @return bool */ public static function safe_inc(&$variable, $increment=1) { if (isset($variable)) { $variable += $increment; } else { $variable = $increment; } return true; } /** * @param int|float $floatnum * * @return int|float */ public static function CastAsInt($floatnum) { // convert to float if not already $floatnum = (float) $floatnum; // convert a float to type int, only if possible if (self::trunc($floatnum) == $floatnum) { // it's not floating pointChangelog
Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-includes/ID3/getid3.lib.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.