Useful Drupal functions
Some useful Drupal functions
<?php
//From includes/common.inc
/**
* Change text depending on single or multiple results
*
*/
$string = format_plural(
count($objects),
'You selected the following <strong>1</strong> row:',
'You selected the following <strong>@count</strong> rows:'
);
/**
* Prepare a URL for use in an HTML attribute. Strips harmful protocols.
*
*/
$uri = check_url($uri);
/**
* Verifies the syntax of the given e-mail address.
* See RFC 2822 for details.
*
*/
$mail_address = valid_email_address($mail_address);
/**
* Verify the syntax of the given URL.
*
*/
$url = valid_url($url, $absolute = FALSE);
?>Knowledge keywords:
