I'm trying to strip the "http://" from the front of a URL that is input into a form, but having some trouble with the regex.
Here is the lin of code I have:
if(preg_match("^http:\/\/$",$_POST['homepage_url'])){ $_POST['homepage_url'] = preg_replace("^http:\/\/$","",$_POST['homepage_url'],1); }
and here is the error message:
Warning: No ending delimiter '' found on line 6
Regex's are probably the one thing in PHP (and PERL) that I still have trouble with on a regular basis.
Thanks
- keith