mirror of
https://github.com/php/doc-ja.git
synced 2026-03-27 08:32:09 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@324609 c90b9560-bf6c-de11-be94-00142212c4b1
158 lines
4.1 KiB
XML
158 lines
4.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<!-- $Revision$ -->
|
||
<!-- EN-Revision: c16824af5770871deac6ea3410f3a1707142ae91 Maintainer: hirokawa Status: ready -->
|
||
<!-- CREDITS: takagi -->
|
||
<refentry xml:id="function.highlight-string" xmlns="http://docbook.org/ns/docbook">
|
||
<refnamediv>
|
||
<refname>highlight_string</refname>
|
||
<refpurpose>文字列の構文ハイライト表示</refpurpose>
|
||
</refnamediv>
|
||
|
||
<refsect1 role="description">
|
||
&reftitle.description;
|
||
<methodsynopsis>
|
||
<type>mixed</type><methodname>highlight_string</methodname>
|
||
<methodparam><type>string</type><parameter>str</parameter></methodparam>
|
||
<methodparam choice="opt"><type>bool</type><parameter>return</parameter><initializer>false</initializer></methodparam>
|
||
</methodsynopsis>
|
||
<simpara>
|
||
PHP 組込みの
|
||
構文ハイライタで定義されたカラーを使用して <parameter>str</parameter>
|
||
を構文ハイライト表示したものを出力あるいは返します。
|
||
</simpara>
|
||
</refsect1>
|
||
|
||
<refsect1 role="parameters">
|
||
&reftitle.parameters;
|
||
<para>
|
||
<variablelist>
|
||
<varlistentry>
|
||
<term><parameter>str</parameter></term>
|
||
<listitem>
|
||
<para>
|
||
ハイライト表示する PHP コード。開始タグを含む必要があります。
|
||
</para>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry>
|
||
<term><parameter>return</parameter></term>
|
||
<listitem>
|
||
<para>
|
||
このパラメータを &true; にすると、この関数はハイライトされたコードを返します。
|
||
</para>
|
||
</listitem>
|
||
</varlistentry>
|
||
</variablelist>
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="returnvalues">
|
||
&reftitle.returnvalues;
|
||
<para>
|
||
<parameter>return</parameter> が &true; の場合は、
|
||
ハイライトされたコードを文字列として返し、表示しません。
|
||
それ以外の場合は、成功した場合に &true;、
|
||
失敗した場合に &false; を返します。
|
||
</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>4.2.0</entry>
|
||
<entry>
|
||
パラメータ <parameter>return</parameter> が追加されました。
|
||
</entry>
|
||
</row>
|
||
</tbody>
|
||
</tgroup>
|
||
</informaltable>
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="examples">
|
||
&reftitle.examples;
|
||
<para>
|
||
<example>
|
||
<title><function>highlight_string</function> の例</title>
|
||
<programlisting role="php">
|
||
<![CDATA[
|
||
<?php
|
||
highlight_string('<?php phpinfo(); ?>');
|
||
?>
|
||
]]>
|
||
</programlisting>
|
||
<para>
|
||
上の例の出力は(PHP 4 では)以下のようになります。
|
||
</para>
|
||
<screen>
|
||
<![CDATA[
|
||
<code><font color="#000000">
|
||
<font color="#0000BB"><?php phpinfo</font><font color="#007700">(); </font><font color="#0000BB">?></font>
|
||
</font>
|
||
</code>
|
||
]]>
|
||
</screen>
|
||
<para>
|
||
上の例の出力は(PHP 5 では)以下のようになります。
|
||
</para>
|
||
<screen>
|
||
<![CDATA[
|
||
<code><span style="color: #000000">
|
||
<span style="color: #0000BB"><?php phpinfo</span><span style="color: #007700">(); </span><span style="color: #0000BB">?></span>
|
||
</span>
|
||
</code>
|
||
]]>
|
||
</screen>
|
||
</example>
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="notes">
|
||
&reftitle.notes;
|
||
¬e.uses-ob;
|
||
</refsect1>
|
||
|
||
<refsect1 role="seealso">
|
||
&reftitle.seealso;
|
||
<para>
|
||
<simplelist>
|
||
<member><function>highlight_file</function></member>
|
||
<member><link linkend="ini.syntax-highlighting">ハイライトに関する INI 設定</link></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
|
||
-->
|