php-doc-en/reference/math/functions/hexdec.xml
2002-06-03 15:06:16 +00:00

66 lines
1.9 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/math.xml, last change in rev 1.16 -->
<refentry id="function.hexdec">
<refnamediv>
<refname>hexdec</refname>
<refpurpose>Hexadecimal to decimal</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>hexdec</methodname>
<methodparam><type>string</type><parameter>hex_string</parameter></methodparam>
</methodsynopsis>
<para>
Returns the decimal equivalent of the hexadecimal number
represented by the <parameter>hex_string</parameter> 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>
<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</title>
<programlisting role="php">
<![CDATA[
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>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->