From bc9b6a1a3266c4ad0c868eab7cc4ec10443e18bc Mon Sep 17 00:00:00 2001 From: Damien Seguy Date: Tue, 12 Jun 2001 16:41:36 +0000 Subject: [PATCH] Added some more details for hexdec git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@49604 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/math.xml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/functions/math.xml b/functions/math.xml index 390ae1c80a..22a7e6bb6e 100644 --- a/functions/math.xml +++ b/functions/math.xml @@ -399,7 +399,7 @@ $binary = base_convert ($hexadecimal, 16, 2); be converted is 2147483647 in decimal resulting to "7fffffff". - See also the hexdec function. + See also hexdec. @@ -542,12 +542,29 @@ $binary = base_convert ($hexadecimal, 16, 2); Returns the decimal equivalent of the hexadecimal number - represented by the hex_string argument. HexDec converts a + represented by the hex_string argument. hexdec converts a hexadecimal string to a decimal number. The largest number that can be converted is 7fffffff or 2147483647 in decimal. - See also the dechex function. + hexdec will replace of any non-hexadecimal + characters it encounters by 0. This way, all + left zeros are ignored, but right zeros will be valued. + + <function>hexdec</function> example</function> + <programlisting role="php"> +var_dump(hexdec("See")); +var_dump(hexdec("ee")); +// both prints "int(238)" + +var_dump(hexdec("that")); +var_dump(hexdec("a0")); +// both prints int(160) + </programlisting> + </example> + </para> + <para> + See also <function>dechex</function>. </para> </refsect1> </refentry>