mirror of
https://github.com/php/doc-ja.git
synced 2026-03-24 07:02:08 +01:00
92 lines
2.5 KiB
XML
92 lines
2.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 53208f9bd0a035a4e1409ba700106540474c9ef1 Maintainer: hirokawa Status: ready -->
|
|
<!-- CREDITS: takagi -->
|
|
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.readline">
|
|
<refnamediv>
|
|
<refname>readline</refname>
|
|
<refpurpose>一行読み込む</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type class="union"><type>string</type><type>false</type></type><methodname>readline</methodname>
|
|
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>prompt</parameter><initializer>&null;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<simpara>
|
|
ユーザーからの入力を一行読み込みます。
|
|
この行を <function>readline_add_history</function>
|
|
を用いてヒストリに追加する必要があります。
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>prompt</parameter></term>
|
|
<listitem>
|
|
<simpara>
|
|
ユーザーに示す確認文字列を指定します。
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<simpara>
|
|
ユーザーから取得した文字列を一つだけ返します。
|
|
戻り値の最後の改行は取り除かれます。
|
|
読み取るデータが残っていない場合、&false; を返します。
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example>
|
|
<title><function>readline</function> の例</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// ユーザーから 3 回コマンドを取得
|
|
for ($i=0; $i < 3; $i++) {
|
|
$line = readline("Command: ");
|
|
readline_add_history($line);
|
|
}
|
|
|
|
// ヒストリをダンプ
|
|
print_r(readline_list_history());
|
|
|
|
// 変数をダンプ
|
|
print_r(readline_info());
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</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
|
|
-->
|