why is the following php code not working:
$string = \"123\";
$search = \"123\";
if(strpos($string,$search))
{
echo \"found\";
}else{
echo \"not fou
strpos returns the numeric position of the string you want to search for if it finds it. So in your case, you want to be doing this instead:
$search = "123";
$string = "123";
if (strpos($string,$search)===false) { echo "not found"; }
else { echo "found"; }
basically it returns a false if it doesn't find your string