URL Checker

This function check if an url is valid or not.

function is_valid_url($url)
{
   return preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url);
}

Tags

No tag here.

Recommended pages

Gregorian to Persian Date Convertor...

Gregorian to Persian Date Convertor....

PHP subwords() Function...

Function subwords, gets words by max num....

Better parse_str in php...

parse_str() is fine for simple stuff but it's not the same as PHP's built way of creating the $_GET magic variable. Why?!?......

Delete or Remove all files and folders in a directory‎...

If you want to delete everything from folder (including subfolders) use this function. function removeDir( $dir ) { if ( is_dir( $dir ) ) { $objects = scandir( $dir ); foreach ( $o...