Вопрос по php – Вопрос по поводу strpos в PHP

2

Я просто пытаюсь понять это ...

$mystring = "/abc/def/hij";
$find = "/abc";

echo(strpos($mystring, $find) . "<br>");
if (strpos($mystring, $find) >= 0) {
    echo("found");
} else {
    echo("not found");
}

this will give : 0 found

$mystring = "/abc/def/hij";
$find = "/fffff";

echo(strpos($mystring, $find) . "<br>");
if (strpos($mystring, $find) >= 0) {
    echo("found");
} else {
    echo("not found");
}

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

$mystring = "/abc/def/hij";
$find = "/fffff";

echo(strpos($mystring, $find) . "<br>");
if (strpos($mystring, $find) **!= false**) {
    echo("found");
} else {
    echo("not found");
}

Error: User Rate Limit Exceeded

$mystring = "/abc/def/hij";
$find = "/abc";

echo(strpos($mystring, $find) . "<br>");
if (strpos($mystring, $find) != false) {
    echo("found");
} else {
    echo("not found");
}

Error: User Rate Limit Exceeded

Ваш Ответ

2   ответа
2

Error: User Rate Limit Exceededus2.php.net/manual/en/function.strpos.php
4

Error: User Rate Limit Exceeded!==Error: User Rate Limit Exceeded

$mystring = "/abc/def/hij";
$find = "/abc";

echo(strpos($mystring, $find) . "<br>");
if (strpos($mystring, $find) !== false) {
    echo("found");
} else {
    echo("not found");
}

Похожие вопросы