Suche, ob ein string in einem anderen string vorhanden ist

für meine Zwecke habe ich dieses:

<?php
$mystring = 'Gazole,';
$findme   = 'Sans Plomb 95';
$pos = strpos($mystring, $findme);

if ($pos >= 0) {
    echo "The string '$findme' was found in the string '$mystring'";
    echo " and exists at position $pos";
} else {
    echo "The string '$findme' was not found in the string '$mystring'";
}
?>

Jedoch, es wird immer in diesem Zweig:

echo "The string '$findme' was found in the string '$mystring'";
echo " and exists at position $pos";

obwohl die Zeichenfolge, die ich 'm auf der Suche für gibt es nicht.

Bitte um Hilfe, thx im Voraus :))

InformationsquelleAutor Malloc | 2011-04-25

Schreibe einen Kommentar