mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
add the new 3rd parameter (before_needle)
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@242052 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
e1effe923c
commit
c3fc93c172
2 changed files with 66 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.13 $ -->
|
||||
<!-- $Revision: 1.14 $ -->
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.stristr">
|
||||
<refnamediv>
|
||||
<refname>stristr</refname>
|
||||
|
@ -12,6 +12,7 @@
|
|||
<type>string</type><methodname>stristr</methodname>
|
||||
<methodparam><type>string</type><parameter>haystack</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>needle</parameter></methodparam>
|
||||
<methodparam><type>bool</type><parameter>before_needle</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns all of <parameter>haystack</parameter> from the first
|
||||
|
@ -39,6 +40,16 @@
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>before_needle</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
If &true; (the default is &false;), <function>strstr</function> returns
|
||||
the part of the <parameter>haystack</parameter> before the first
|
||||
occurence of the <parameter>needle</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
<para>
|
||||
|
@ -55,6 +66,36 @@
|
|||
</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>6.0.0</entry>
|
||||
<entry>
|
||||
Added the <parameter>before_needle</parameter> parameter.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>4.3.0</entry>
|
||||
<entry>
|
||||
<function>strstr</function> was made binary safe.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
|
@ -64,8 +105,8 @@
|
|||
<![CDATA[
|
||||
<?php
|
||||
$email = 'USER@EXAMPLE.com';
|
||||
echo stristr($email, 'e');
|
||||
// outputs ER@EXAMPLE.com
|
||||
echo stristr($email, 'e'); // outputs ER@EXAMPLE.com
|
||||
echo stristr($email, 'e', true); // outputs US
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.12 $ -->
|
||||
<!-- $Revision: 1.13 $ -->
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.strstr">
|
||||
<refnamediv>
|
||||
<refname>strstr</refname>
|
||||
|
@ -12,6 +12,7 @@
|
|||
<type>string</type><methodname>strstr</methodname>
|
||||
<methodparam><type>string</type><parameter>haystack</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>needle</parameter></methodparam>
|
||||
<methodparam><type>bool</type><parameter>before_needle</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns part of <parameter>haystack</parameter> string from the first
|
||||
|
@ -54,6 +55,16 @@
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>before_needle</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
If &true; (the default is &false;), <function>strstr</function> returns
|
||||
the part of the <parameter>haystack</parameter> before the first
|
||||
occurence of the <parameter>needle</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
@ -78,6 +89,12 @@
|
|||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>6.0.0</entry>
|
||||
<entry>
|
||||
Added the <parameter>before_needle</parameter> parameter.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>4.3.0</entry>
|
||||
<entry>
|
||||
|
@ -98,9 +115,12 @@
|
|||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$email = 'user@example.com';
|
||||
$email = 'name@example.com';
|
||||
$domain = strstr($email, '@');
|
||||
echo $domain; // prints @example.com
|
||||
|
||||
$user = strstr($email, '@', true);
|
||||
echo $user; // prints name
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
|
Loading…
Reference in a new issue