mirror of
https://github.com/php/doc-ja.git
synced 2026-03-25 15:42:08 +01:00
143 lines
3.7 KiB
XML
143 lines
3.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 761d72245071f89a626903c9bcdc6aaff1252d54 Maintainer: hirokawa Status: ready -->
|
|
<!-- Credits: mumumu -->
|
|
<refentry xml:id="function.hexdec" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>hexdec</refname>
|
|
<refpurpose>16 進数を 10 進数に変換する</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type class="union"><type>int</type><type>float</type></type><methodname>hexdec</methodname>
|
|
<methodparam><type>string</type><parameter>hex_string</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
引数 <parameter>hex_string</parameter> により指定された 16 進数に
|
|
等価な 10 進数を返します。<function>hexdec</function> は、16 進数を
|
|
表す文字列を 10 進数に変換します。
|
|
</para>
|
|
<para>
|
|
<function>hexdec</function> は、16 進数以外の文字を一切無視します。
|
|
PHP 7.4.0 以降では、無効な文字を与えることは推奨されません。
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>hex_string</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
変換したい 16 進文字列。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
<parameter>hex_string</parameter> を 10 進で表した値を返します。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>7.4.0</entry>
|
|
<entry>
|
|
無効な文字を与えると、非推奨の警告が出るようになりました。
|
|
結果は不正な文字がなかったかのように計算されます。
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>hexdec</function> の例</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
var_dump(hexdec("ee")); // prints "int(238)"
|
|
var_dump(hexdec("a0")); // prints "int(160)"
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>不正な文字を <function>hexdec</function> に適用した例</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
var_dump(hexdec("See")); // print "int(238)"
|
|
var_dump(hexdec("that")); // print "int(10)"
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
<note>
|
|
<para>
|
|
この関数は、プラットフォームの <type>int</type> 型に収まらない大きな数も変換できます。
|
|
その場合、結果は <type>float</type> で返します。
|
|
</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
|
|
-->
|