form_clean_id

Definition

form_clean_id($id = NULL)
includes/form.inc, line 1190

Description

Remove invalid characters from an HTML ID attribute string.

Parameters

$id The ID to clean

Return value

The cleaned ID

Related topics

Namesort iconDescription
Form generationFunctions to enable output of HTML forms and form elements.

Code

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

Drupal is a registered trademark of Dries Buytaert.