You are here

function role_export_machine_name_gen in Role Export 6

Same name and namespace in other branches
  1. 7 role_export.module \role_export_machine_name_gen()

Generates a machine_name from a role name.

2 calls to role_export_machine_name_gen()
role_export_normalize in ./role_export.module
Ensure that all rids are hashes of their machine_name.
role_export_role_machine_name_validate in ./role_export.module
Ensure the machine_name of the new role is valid and doesn't already exist.

File

./role_export.module, line 146
Role Export's primary module file.

Code

function role_export_machine_name_gen($name) {

  // Convert any non-alphanumeric characters into underscores.
  return preg_replace('/[^a-z0-9]+/', '_', strtolower($name));
}