mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-26 05:48:57 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@129021 c90b9560-bf6c-de11-be94-00142212c4b1
88 lines
2.2 KiB
XML
88 lines
2.2 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.2 $ -->
|
|
<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
|
|
-->
|