mirror of
https://github.com/php/doc-de.git
synced 2026-04-28 01:13:12 +02:00
17d689a19f
git-svn-id: https://svn.php.net/repository/phpdoc/de/trunk@212339 c90b9560-bf6c-de11-be94-00142212c4b1
108 lines
3.4 KiB
XML
108 lines
3.4 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.2 $ -->
|
|
<!-- EN-Revision: 1.9 Maintainer: sammywg Status: ready -->
|
|
<refentry id="function.stripos">
|
|
<refnamediv>
|
|
<refname>stripos</refname>
|
|
<refpurpose>
|
|
Findet das erste Vorkommen eines Strings, unabhängig von Groß- und
|
|
Kleinschreibung
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Beschreibung</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>stripos</methodname>
|
|
<methodparam><type>string</type><parameter>haystack</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>needle</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>offset</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Gibt die numerische Position des ersten Vorkommens von
|
|
<parameter>needle</parameter> innerhalb des <type>Strings</type>
|
|
<parameter>haystack</parameter> zurück. Im Gegensatz zu
|
|
<function> strpos</function> ist <function>stripos</function>
|
|
unabhängig von Groß- und Kleinschreibung.
|
|
</para>
|
|
<para>
|
|
Beachten Sie, dass <parameter>needle</parameter> eine Zeichenkette von
|
|
einem oder mehreren Zeichen sein kann.
|
|
</para>
|
|
<para>
|
|
Wenn <parameter>needle</parameter> nicht gefunden wird, gibt
|
|
<function>stripos</function> den <type>boolean</type>-Wert &false; zurück.
|
|
</para>
|
|
|
|
&return.falseproblem;
|
|
|
|
<para>
|
|
<example>
|
|
<title><function>stripos</function> Beispiele</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$findmich = 'a';
|
|
$meinstring1 = 'xyz';
|
|
$meinstring2 = 'ABC';
|
|
|
|
$pos1 = stripos($meinstring1, $findmich);
|
|
$pos2 = stripos($meinstring2, $findmich);
|
|
|
|
// 'a' ist natürlich nicht in 'xyz' enthalten
|
|
if ($pos1 === false) {
|
|
echo "Die Zeichenkette '$findmich' kommt nicht im String '$meinstring1' vor.";
|
|
}
|
|
|
|
// Beachten Sie die Verwendung von ===. Ein einfaches == funktioniert nicht wie
|
|
// erwartet, da 'a' an Position 0 (also erster!) Stelle steht
|
|
if ($pos2 !== false) {
|
|
echo "Die Zeichenkette '$findmich' wurde in '$meinstring2' an Position $pos2 gefunden";
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
Ist <parameter>needle</parameter> kein String, wird der Parameter in einen
|
|
Integerwert konvertiert, der dem Ordinalwert des Zeichens entspricht.
|
|
</para>
|
|
<para>
|
|
Der optionale Parameter <parameter>offset</parameter> erlaubt Ihnen anzugeben,
|
|
ab welchem Zeichen in <parameter>haystack</parameter> die Suche begonnen werden
|
|
soll. Die zurückgegebene Position bezieht sich jedoch auf den Anfang von
|
|
<parameter>haystack</parameter>.
|
|
</para>
|
|
|
|
¬e.bin-safe;
|
|
|
|
<para>
|
|
Siehe auch <function>strpos</function>, <function>strrpos</function>,
|
|
<function>strrchr</function>, <function>substr</function>,
|
|
<function>stristr</function>, <function>strstr</function>,
|
|
<function>strripos</function> und <function>str_ireplace</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
|
|
-->
|