You are here

function bat_options_get_machine_name in Booking and Availability Management Tools for Drupal 7

Same name and namespace in other branches
  1. 8 modules/bat_options/bat_options.module \bat_options_get_machine_name()

Converts option human name to its machine name.

Parameters

string $option_name: The human option name.

string $pattern: The pattern used to convert. By default "/[^a-z0-9_]+/".

string $replacement: The replacement string. By default "_".

Return value

string The option machine name.

File

modules/bat_options/bat_options.module, line 519

Code

function bat_options_get_machine_name($option_name, $pattern = '/[^a-z0-9_]+/', $replacement = '_') {
  return preg_replace($pattern, $replacement, drupal_strtolower($option_name));
}