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 beginn
Use caution when using strpos(). It will return 0 when 'http://' is found at the beginning of the string, causing your if statement to fail unexpectedly. You will want to check the type of the return to be sure:
$domain = $_POST["domain"];
if (FALSE !== strpos($domain, "http://")) {
return $domain;
} else {
return "http://" . $domain;
}