Archive for the ‘PHP’ Category

PHP : get Request protocol Http or HTTPS

This item was filled under [ PHP ]

How to get Requested protocol Http or HTTPS in PHP?
This function will return True if HTTPS when called…
is_https()
{
return strtolower(substr($_SERVER["SERVER_PROTOCOL"],0,5))==’https’? true : false;
}
is_https()
{
return strtolower(substr($_SERVER["SERVER_PROTOCOL"],0,5))==’https’? true : false;
}

Continue reading...

Tagged with: [ , , ]

PHP URL Validate using RegEx

This item was filled under [ PHP ]

After going through lots and lots of url validation scripts, I come across this wonderful and easy RegEx validation script works perfectly. This information has been posted in phpcentral by fqa. Amazingly author has also given detailed information for switching how a URL should be. For example, http://localhost is a VALID URL and you may [...]

Continue reading...

Tagged with: [ , , , ]