form_clean_id

  1. drupal
    1. 4.7
    2. 5
    3. 6 form.inc
Versions
4.7 – 5 form_clean_id($id = NULL)
6 form_clean_id($id = NULL, $flush = FALSE)

Remove invalid characters from an HTML ID attribute string.

Parameters

$id The ID to clean

Return value

The cleaned ID

Related topics

▾ 2 functions call form_clean_id()

theme_file in includes/form.inc
Format a file upload field.
theme_form_element in includes/theme.inc
Return a themed form element.

Code

includes/form.inc, line 1191

<?php
function form_clean_id($id = NULL) {
  $id = str_replace('][', '-', $id);
  return $id;
}
?>