Question about strpos in PHP
<p>I'm just trying to figure that out... </p>

<pre><code>$mystring = "/abc/def/hij";
$find = "/abc";

echo(strpos($mystring, $find) . "&lt;br&gt;");
if (strpos($mystring, $find) &gt;= 0) {
    echo("found");
} else {
    echo("not found");
}
</code></pre>

<p>this will give :
0
found</p>

<pre><code>$mystring = "/abc/def/hij";
$find = "/fffff";

echo(strpos($mystring, $find) . "&lt;br&gt;");
if (strpos($mystring, $find) &gt;= 0) {
    echo("found");
} else {
    echo("not found");
}
</code></pre>

<p>output :
[blank]
found</p>

<p>Now if I change the comparator and use "!= False" instead of ">= 0"</p>

<pre><code>$mystring = "/abc/def/hij";
$find = "/fffff";

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

<p>This works in almost all cases, except when I look for the substring at the beginning of the string. For example, this will output "not found" :</p>

<pre><code>$mystring = "/abc/def/hij";
$find = "/abc";

echo(strpos($mystring, $find) . "&lt;br&gt;");
if (strpos($mystring, $find) != false) {
    echo("found");
} else {
    echo("not found");
}
</code></pre>

<p>So how can I make that work? I just want to know if a substring exists in a string, and it should give me "true" if the substring is the beginning or the entire string...</p>
