I was having trouble with a longer func i wrote, so i broke it down and it seems to be with the strpos()
function.
Even though the needle is clearly present in the haystack it returns false, for the life of me i cant work out why, oddly though if i change the needle to "sam" in becomes true.. any idea why ?
function verify_url($url) {
if (strpos($url, "http://")) {
return $url;
} else {
echo "error";
}
}
$url = "http://sam.com";
echo verify_url($url);