Added some more details for hexdec

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@49604 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Damien Seguy 2001-06-12 16:41:36 +00:00
parent 4a880aec9e
commit bc9b6a1a32

View file

@ -399,7 +399,7 @@ $binary = base_convert ($hexadecimal, 16, 2);
be converted is 2147483647 in decimal resulting to "7fffffff".
</para>
<para>
See also the <function>hexdec</function> function.
See also <function>hexdec</function>.
</para>
</refsect1>
</refentry>
@ -542,12 +542,29 @@ $binary = base_convert ($hexadecimal, 16, 2);
</funcsynopsis>
<para>
Returns the decimal equivalent of the hexadecimal number
represented by the hex_string argument. HexDec converts a
represented by the hex_string argument. <function>hexdec</function> converts a
hexadecimal string to a decimal number. The largest number that
can be converted is 7fffffff or 2147483647 in decimal.
</para>
<para>
See also the <function>dechex</function> function.
<function>hexdec</function> will replace of any non-hexadecimal
characters it encounters by <literal>0</literal>. This way, all
left zeros are ignored, but right zeros will be valued.
<example>
<title><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>