Jun
25
2011

Validating URL’s in Drupal

Drupal 7 (sense 4.6, and possibly earlier) has included built a built in URL verification function.

valid_url($url, $absolute = FALSE)

Usage is simple.

if (valid_url($myURL)) {
     //is a valid URL;
     return TRUE;
} else {
     //is not a valid URL
     return FALSE;
}
Written by Josh Sommers in: Uncategorized |

No Comments »

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress | Aeros Theme | TheBuckmaker WordPress Themes