nlopess Sat Sep 1 18:36:14 2007 UTC
Modified files:
/phpdoc/en/reference/strings/functions stristr.xml strstr.xml
Log:
add the new 3rd parameter (before_needle)
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/strings/functions/stristr.xml?r1=1.13&r2=1.14&diff_format=u
Index: phpdoc/en/reference/strings/functions/stristr.xml
diff -u phpdoc/en/reference/strings/functions/stristr.xml:1.13
phpdoc/en/reference/strings/functions/stristr.xml:1.14
--- phpdoc/en/reference/strings/functions/stristr.xml:1.13 Wed Jun 20
22:25:31 2007
+++ phpdoc/en/reference/strings/functions/stristr.xml Sat Sep 1 18:36:14 2007
@@ -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 = '[EMAIL PROTECTED]';
- echo stristr($email, 'e');
-// outputs [EMAIL PROTECTED]
+ echo stristr($email, 'e'); // outputs [EMAIL PROTECTED]
+ echo stristr($email, 'e', true); // outputs US
?>
]]>
</programlisting>
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/strings/functions/strstr.xml?r1=1.12&r2=1.13&diff_format=u
Index: phpdoc/en/reference/strings/functions/strstr.xml
diff -u phpdoc/en/reference/strings/functions/strstr.xml:1.12
phpdoc/en/reference/strings/functions/strstr.xml:1.13
--- phpdoc/en/reference/strings/functions/strstr.xml:1.12 Wed Jun 20
22:25:31 2007
+++ phpdoc/en/reference/strings/functions/strstr.xml Sat Sep 1 18:36:14 2007
@@ -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>
@@ -79,6 +90,12 @@
</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.
@@ -98,9 +115,12 @@
<programlisting role="php">
<![CDATA[
<?php
-$email = '[EMAIL PROTECTED]';
+$email = '[EMAIL PROTECTED]';
$domain = strstr($email, '@');
echo $domain; // prints @example.com
+
+$user = strstr($email, '@', true);
+echo $user; // prints name
?>
]]>
</programlisting>