1
0
mirror of https://github.com/php/doc-ja.git synced 2026-04-25 00:48:05 +02:00
Files
archived-doc-ja/reference/strings/functions/hex2bin.xml
T
TAKAGI Masahiro 0015b0d102 sync with en.
git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@325995 c90b9560-bf6c-de11-be94-00142212c4b1
2012-06-05 23:09:33 +00:00

137 lines
3.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: cb80c22afbb34bf464b40c7c96d5d33fb86d2594 Maintainer: takagi Status: ready -->
<refentry xml:id="function.hex2bin" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>hex2bin</refname>
<refpurpose>16進エンコードされたバイナリ文字列をデコードする</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>hex2bin</methodname>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
</methodsynopsis>
<para>
16進エンコードされたバイナリ文字列をデコードします。
</para>
<caution>
<para>
これは、16進数を2進数に変換する関数では<emphasis>ありません</emphasis>
2進数への変換には <function>base_convert</function> 関数を使いましょう。
</para>
</caution>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>data</parameter></term>
<listitem>
<para>
16進表現のデータ。
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
指定したデータを2進表現に変換したものを返します。
&return.falseforfailure;
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
16進表現の入力文字列長が奇数の場合は <constant>E_WARNING</constant>
レベルのエラーが発生します。
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>5.4.1</entry>
<entry>
入力の文字列長が奇数の場合に警告を発するようになりました。
PHP 5.4.0 ではそんな文字列も黙って受け入れていましたが、
最終バイトは無視されていました。
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example xml:id="hex2bin.example.basic">
<title><function>hex2bin</function> の例</title>
<programlisting role="php">
<![CDATA[
<?php
$hex = hex2bin("6578616d706c65206865782064617461");
var_dump($hex);
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
string(16) "example hex data"
]]>
</screen>
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>bin2hex</function></member>
<member><function>unpack</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
-->