You are here

function isbn_clean_data in ISBN Field 7

Remove all non-valid characters.

Parameters

$isbn: The ISBN number typed by the user.

Return value

The ISBN number without invalid characters.

2 calls to isbn_clean_data()
isbn_field_presave in ./isbn.module
Implements hook_field_presave().
isbn_field_validate in ./isbn.module
Implements hook_field_validate().

File

./isbn.module, line 165
Maintains a consistant relationship between nodes and ISBNs.

Code

function isbn_clean_data($isbn) {
  return preg_replace('/([^xX0-9]*)/', "", $isbn);
}