if http:// is in string then leave it, else if not add it
<p>I have a input that you enter a URL, i basically want to write some php that says if the domain containts "http://" then leave it be, else if not then add it to the beginning.
This is what I have so far...</p>

<pre><code>$domain = $_POST["domain"];

if (strpos($domain, "http://")) {
return $domain;
} else {
$domain = "http://" . $domain;
}
</code></pre>

<p>This doesnt seem to work..</p>

<p>it doesnt add the http:// on if it doesnt contain http://.</p>
