So I am trying to find a proper way to use regex in PHP to find if a variable contains "http:/" but not "http://". Basically I have a script that in some rare instances one of the slashes gets removed from a URL so I need to check to see if the slash got removed and add it back if it did.
Any help is appreciated (I suck at regex and Google hasn't been very helpful). Here's the code I have to find "http://" in a variable:
Any help is appreciated (I suck at regex and Google hasn't been very helpful). Here's the code I have to find "http://" in a variable:
Code:
preg_match("#https?://#", $url)