- strpos: documentation ( source)
<?php
class x
{
public function __construct()
{
$strHaystack='test';
$strNeedle='t';
$numPos=strpos($strHaystack,$strNeedle);
if($numPos!==false)
print "Found '$strNeedle' at position: $numPos\r\n";
else print "Not Found!\r\n";
}
}