binary safety

start and length optional parameters


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@161469 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Jakub Vrana 2004-06-16 08:30:20 +00:00
parent a2733613ef
commit 4892a2df3c
2 changed files with 27 additions and 2 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 -->
<refentry id="function.strcspn">
<refnamediv>
@ -14,12 +14,20 @@
<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 the initial segment of
<parameter>str1</parameter> which does <emphasis>not</emphasis>
contain any of the characters in <parameter>str2</parameter>.
</simpara>
<simpara>
As of PHP 4.0B1 this function is binary safe.
Additionally it accepts two optional integer
parameters that can be used to define the starting position
and the length of the string to examine.
</simpara>
<simpara>
See also <function>strspn</function>.
</simpara>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 -->
<refentry id="function.strspn">
<refnamediv>
@ -14,6 +14,8 @@
<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 initial segment of
@ -34,6 +36,21 @@ $var = strspn("42 is the answer, what is the question ...", "1234567890");
will assign 2 to <varname>$var</varname>, because the string "42" will
be the longest segment containing characters from "1234567890".
</para>
<para>
As of PHP 4.0B1 this function is binary safe.
Additionally it accepts two optional integer
parameters that can be used to define the starting position
and the length of the string to examine.
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
echo strspn("foo", "o", 1, 2); // 2
?>
]]>
</programlisting>
</informalexample>
</para>
<simpara>
See also <function>strcspn</function>.
</simpara>