function config_perms_generate_machine_name in Custom Permissions 6.2
Same name and namespace in other branches
- 7.2 config_perms.module \config_perms_generate_machine_name()
Generate a machine name given a string
1 call to config_perms_generate_machine_name()
- config_perms_save in ./
config_perms.module - Inserts or updates a perm into the database.
File
- ./
config_perms.module, line 219 - Adds more granular permissions for items under 'administer site configuration'.
Code
function config_perms_generate_machine_name($string) {
//return preg_replace('/[^[:alnum:]_]/', '_', strtolower(trim($string) ) );
return strtolower(preg_replace('/[^a-zA-Z0-9_]+/', '_', $string));
}