Attached are the modified docs
Andrey
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 -->
<refentry id="function.strspn">
<refnamediv>
<refname>strspn</refname>
<refpurpose>
Find length of a segment matching mask
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>strspn</methodname>
<methodparam><type>string</type><parameter>str1</parameter></methodparam>
<methodparam><type>string</type><parameter>str2</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>start</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>length</parameter></methodparam>
</methodsynopsis>
<simpara>
Returns the length of the segment of
<parameter>str1</parameter> which consists entirely of characters
in <parameter>str2</parameter>.
In case only 2 parameters are passed the length of the initial segment is returned.
On the other hand if the additional parameters
<parameter>start</parameter> and <parameter>length</parameter> are provided
only part of the string will be checked. The way these parameters are handled is the
same as in the <function>substr</function> function (this functionality is available
in versions >= 4.3.0).
</simpara>
<para>
The line of code:
<informalexample>
<programlisting role="php">
<![CDATA[
$var1 = strspn("42 is the answer, what is the question ...", "1234567890.");
$var2 = strspn("This extended functionality starts at 4.3.0 version", "1234567890.", 38); //returns 5 - "4.3.0"
$var3 = strspn("This extended functionality starts at 4.3.0 version", "1234567890.", 40); //returns 3 - "3.0"
$var4 = strspn("This extended functionality starts at 4.3.0 version", "1234567890.", 38,3); //returns 3 - "4.3"
]]>
</programlisting>
</informalexample>
will assign 2 to <varname>$var1</varname>, because the string "42" will
be the longest segment containing characters from "1234567890." (counted from the beggining of the string).
<varname>$var2</varname>, <varname>$var3</varname> and <varname>$var4</varname> will contain respectively
5, 3 and 3. <varname>$var3</varname> will be 3 because the search is started at position 40th in the string
and the longest segment is "3.0". Because of the 4th parameter in the last example only 3 positions in the
string are checked from 38 through 41. This range contains the "4.3" string.
</para>
<simpara>
See also <function>strcspn</function>.
</simpara>
</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:"../../../../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
-->
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 -->
<refentry id="function.strcspn">
<refnamediv>
<refname>strcspn</refname>
<refpurpose>
Find length of a segment not matching mask
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>strcspn</methodname>
<methodparam><type>string</type><parameter>str1</parameter></methodparam>
<methodparam><type>string</type><parameter>str2</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>start</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>length</parameter></methodparam>
</methodsynopsis>
<simpara>
Returns the length of a segment of
<parameter>str1</parameter> which does <emphasis>not</emphasis>
contain any of the characters in <parameter>str2</parameter>.
In case only 2 parameters are passed the length of the initial segment is returned.
On the other hand if the additional parameters
<parameter>start</parameter> and <parameter>length</parameter> are provided
only part of the string will be checked. The way these parameters are handled is the
same as in the <function>substr</function> function (this functionality is available
in versions >= 4.3.0).
</simpara>
<para>
The line of code:
<informalexample>
<programlisting role="php">
<![CDATA[
$var1 = strcspn("so 42 is the answer, what is the question ...", "1234567890");
$var2 = strcspn("This extended functionality starts at 4.3.0 version", "1234567890.", 28); //returns 10 - "starts at "
$var3 = strcspn("This extended functionality starts at 4.3.0 version", "1234567890.", 28,6); //returns 6 - "starts"
$var4 = strcspn("This extended functionality starts at 4.3.0 version", "1234567890.", 28,16); //returns 10 - "starts at "
]]>
</programlisting>
</informalexample>
will assign 3 to <varname>$var1</varname>, because the string "so " will
be the longest segment not containing characters from "1234567890." (counted from the beggining of the string).
<varname>$var2</varname>, <varname>$var3</varname> and <varname>$var4</varname> will contain respectively
10, 6 and 10. <varname>$var3</varname> will be 3 because the search is started at position 28th in the string
and the longest segment is "starts". Because of the 4th parameter in the last example 16 positions in the
string are checked from 28 through 44. This range contains the "starts at 4.3.0 " string.
</para>
<simpara>
See also <function>strspn</function>.
</simpara>
</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:"../../../../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
-->
--
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php