php-doc-en/reference/math/functions/hexdec.xml
Maciej Sobaczewski 1cd19d56e1 W/S fixes
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@334617 c90b9560-bf6c-de11-be94-00142212c4b1
2014-08-27 05:42:22 +00:00

107 lines
2.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.hexdec" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>hexdec</refname>
<refpurpose>Hexadecimal to decimal</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>number</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.
</para>
<para>
<function>hexdec</function> will ignore any non-hexadecimal
characters it encounters.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>hex_string</parameter></term>
<listitem>
<para>
The hexadecimal string to convert
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The decimal representation of <parameter>hex_string</parameter>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>hexdec</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
var_dump(hexdec("See"));
var_dump(hexdec("ee"));
// both print "int(238)"
var_dump(hexdec("that")); // print "int(10)"
var_dump(hexdec("a0")); // print "int(160)"
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
The function can convert numbers that are too large to fit into the platforms
<type>integer</type> type, larger values are returned as <type>float</type> in
that case.
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>dechex</function></member>
<member><function>bindec</function></member>
<member><function>octdec</function></member>
<member><function>base_convert</function></member>
</simplelist>
</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:"~/.phpdoc/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
-->