Input validation


Functions

 valid_email_address ($mail)
 valid_url ($url, $absolute=FALSE)

Detailed Description

Functions to validate user input.

Function Documentation

valid_email_address ( mail  ) 

Verify the syntax of the given e-mail address.

Empty e-mail addresses are allowed. See RFC 2822 for details.

Parameters:
$mail A string containing an e-mail address.
Returns:
TRUE if the address is in a valid format.

valid_url ( url,
absolute = FALSE 
)

Verify the syntax of the given URL.

This function should only be used on actual URLs. It should not be used for Drupal menu paths, which can contain arbitrary characters. Valid values per RFC 3986.

Parameters:
$url The URL to verify.
$absolute Whether the URL is absolute (beginning with a scheme such as "http:").
Returns:
TRUE if the URL is in a valid format.