Initial documentation.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@128956 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Philip Olson 2003-05-28 00:28:35 +00:00
parent 9d5e023bf5
commit 36ace4cf04

View file

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<refentry id="function.strripos">
<refnamediv>
<refname>strripos</refname>
<refpurpose>
Find position of last occurrence of a case-insensitive string in a string
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>strripos</methodname>
<methodparam><type>string</type><parameter>haystack</parameter></methodparam>
<methodparam><type>string</type><parameter>needle</parameter></methodparam>
</methodsynopsis>
<para>
Returns the numeric position of the last occurrence of
<parameter>needle</parameter> in the
<parameter>haystack</parameter> string. Unlike
<function>strrpos</function>, <function>strripos</function> is
case-insensitive. Also note that string positions start at 0, and not
1.
</para>
<para>
If <parameter>needle</parameter> is not found, &false; is returned.
</para>
&return.falseproblem;
<para>
<example>
<title>A simple <function>strripos</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$haystack = 'ababcd';
$needle = 'ab';
$pos = strripos($haystack, $needle);
if ($pos === false) {
echo "Sorry, we did not find ($needle) in ($haystack)";
} else {
echo "Congratulations!\n";
echo "We found the last ($needle) in ($haystack) at position ($pos)";
}
/* Outputs:
Congratulations!
We found the last (ab) in (ababcd) at position (2)
*/
?>
]]>
</programlisting>
</example>
</para>
<para>
See also <function>strrpos</function>,
<function>strrchr</function>,
<function>substr</function>, and
<function>stristr</function>.
</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:"../../../../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
-->