svn: /phpdoc/ja/trunk/reference/strings/functions/ str-contains.xml stripos.xml strpos.xml

[email protected] (Yoshinari Takaoka)
Newsgroups php.doc.ja
Message-ID <[email protected]>
mumumu                                   Tue, 24 Nov 2020 02:14:24 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=351559

Log:
Added documentation for the str_contains function based on the RFC here: https://wiki.php.net/rfc/str_contains

Patch contributed by Emmanuel Okeke <[email protected]>.

Changed paths:
    A   phpdoc/ja/trunk/reference/strings/functions/str-contains.xml
    U   phpdoc/ja/trunk/reference/strings/functions/stripos.xml
    U   phpdoc/ja/trunk/reference/strings/functions/strpos.xml

Added: phpdoc/ja/trunk/reference/strings/functions/str-contains.xml
===================================================================
--- phpdoc/ja/trunk/reference/strings/functions/str-contains.xml	                        (rev 0)
+++ phpdoc/ja/trunk/reference/strings/functions/str-contains.xml	2020-11-24 02:14:24 UTC (rev 351559)
@@ -0,0 +1,154 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision$ -->
+<!-- EN-Revision: 351549 Maintainer: mumumu Status: ready -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.str-contains">
+ <refnamediv>
+  <refname>str_contains</refname>
+  <refpurpose>指定された部分文字列が、文字列に含まれるかを調べる</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+  &reftitle.description;
+  <methodsynopsis>
+   <type>bool</type><methodname>str_contains</methodname>
+   <methodparam><type>string</type><parameter>haystack</parameter></methodparam>
+   <methodparam><type>string</type><parameter>needle</parameter></methodparam>
+  </methodsynopsis>
+  <para>
+   <parameter>needle</parameter> が
+   <parameter>haystack</parameter> に含まれるかを調べます。
+   大文字小文字は区別されます。
+  </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+  &reftitle.parameters;
+  <para>
+   <variablelist>
+    <varlistentry>
+     <term><parameter>haystack</parameter></term>
+     <listitem>
+      <para>
+       検索対象の文字列
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><parameter>needle</parameter></term>
+     <listitem>
+      <para>
+       <parameter>haystack</parameter> で調べる部分文字列
+      </para>
+     </listitem>
+    </varlistentry>
+   </variablelist>
+  </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+  &reftitle.returnvalues;
+  <para>
+   <parameter>haystack</parameter> に
+   <parameter>needle</parameter> が含まれていた場合 &true;
+   そうでない場合、&false; を返します。
+  </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+  &reftitle.examples;
+  <para>
+   <example>
+    <title>空文字列 <literal>''</literal> を使った場合</title>
+    <programlisting role="php">
+<![CDATA[
+<?php
+if (str_contains('abc', '')) {
+    echo "Checking the existence of the empty string will always return true";
+}
+?>
+]]>
+    </programlisting>
+    &example.outputs;
+    <screen role="php">
+<![CDATA[
+Checking the existence of the empty string will always return true
+]]>
+    </screen>
+   </example>
+
+   <example>
+    <title>大文字小文字の区別</title>
+    <programlisting role="php">
+<![CDATA[
+<?php
+$string = 'The lazy fox jumped over the fence';
+
+if (str_contains($string, 'lazy')) {
+    echo "The string 'lazy' was found in the string\n";
+}
+
+if (str_contains($string, 'Lazy')) {
+    echo 'The string "Lazy" was found in the string';
+} else {
+    echo '"Lazy" was not found because the case does not match';
+}
+
+?>
+]]>
+    </programlisting>
+    &example.outputs;
+    <screen role="php">
+<![CDATA[
+The string 'lazy' was found in the string
+"Lazy" was not found because the case does not match
+]]>
+    </screen>
+   </example>
+  </para>
+ </refsect1>
+
+ <refsect1 role="notes">
+  &reftitle.notes;
+  &note.bin-safe;
+ </refsect1>
+
+ <refsect1 role="seealso">
+  &reftitle.seealso;
+  <para>
+   <simplelist>
+    <member><function>str_ends_with</function></member>
+    <member><function>str_starts_with</function></member>
+    <member><function>stripos</function></member>
+    <member><function>strrpos</function></member>
+    <member><function>strripos</function></member>
+    <member><function>strstr</function></member>
+    <member><function>strpbrk</function></member>
+    <member><function>substr</function></member>
+    <member><function>preg_match</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
+-->


Property changes on: phpdoc/ja/trunk/reference/strings/functions/str-contains.xml
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL
\ No newline at end of property
Modified: phpdoc/ja/trunk/reference/strings/functions/stripos.xml
===================================================================
--- phpdoc/ja/trunk/reference/strings/functions/stripos.xml	2020-11-24 02:03:34 UTC (rev 351558)
+++ phpdoc/ja/trunk/reference/strings/functions/stripos.xml	2020-11-24 02:14:24 UTC (rev 351559)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- $Revision$ -->
-<!-- EN-Revision: 350636 Maintainer: takagi Status: ready -->
+<!-- EN-Revision: 351549 Maintainer: takagi Status: ready -->
 <!-- CREDITS: hirokawa,mumumu -->
 <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.stripos">
  <refnamediv>
@@ -144,6 +144,9 @@
   <para>
    <simplelist>
     <member><function>mb_stripos</function></member>
+    <member><function>str_contains</function></member>
+    <member><function>str_ends_with</function></member>
+    <member><function>str_starts_with</function></member>
     <member><function>strpos</function></member>
     <member><function>strrpos</function></member>
     <member><function>strripos</function></member>

Modified: phpdoc/ja/trunk/reference/strings/functions/strpos.xml
===================================================================
--- phpdoc/ja/trunk/reference/strings/functions/strpos.xml	2020-11-24 02:03:34 UTC (rev 351558)
+++ phpdoc/ja/trunk/reference/strings/functions/strpos.xml	2020-11-24 02:14:24 UTC (rev 351559)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- $Revision$ -->
-<!-- EN-Revision: 350636 Maintainer: takagi Status: ready -->
+<!-- EN-Revision: 351549 Maintainer: takagi Status: ready -->
 <!-- CREDITS: hirokawa,mumumu -->
 <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.strpos">
  <refnamediv>
@@ -167,6 +167,9 @@
   <para>
    <simplelist>
     <member><function>stripos</function></member>
+    <member><function>str_contains</function></member>
+    <member><function>str_ends_with</function></member>
+    <member><function>str_starts_with</function></member>
     <member><function>strrpos</function></member>
     <member><function>strripos</function></member>
     <member><function>strstr</function></member>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.