I have this code
if(preg_match("/http(s?):\/\//",$clicksurl)){ //good url and not missing the http:// }else{ //bad url and is missing the http:// }
How do I also make sure if it has www. in it and if it doesn't then its a bad url
"/http(s?):\/\/www\./"
However, that begs the question as to why you are assuming that all the URLs you expect to be checking must have a 'www' sub-domain?
OR that even if a URL contains www. it may not be valid (ex. http://www.this:isn'tvalid!.com).