getid3_lib::Bin2Dec

Advertisement

Syntax Syntax

getid3_lib::Bin2Dec( string $binstring, bool $signed = false )

Parameters Parameters

$binstring

(Required)

$signed

(Optional)

Default value: false

Return Return

(int|float)

Source Source

File: wp-includes/ID3/getid3.lib.php

			if ($binstring[0] == '1') {
				$signmult = -1;
			}
			$binstring = substr($binstring, 1);
		}
		$decvalue = 0;
		for ($i = 0; $i < strlen($binstring); $i++) {
			$decvalue += ((int) substr($binstring, strlen($binstring) - $i - 1, 1)) * pow(2, $i);
		}
		return self::CastAsInt($decvalue * $signmult);
	}

	/**
	 * @param string $binstring

Advertisement

Advertisement

Leave a Reply