You are here

function _google_admanager_clean_string in DFP Small Business (Google Ad Manager) 7.2

Same name and namespace in other branches
  1. 6.3 google_admanager.module \_google_admanager_clean_string()
  2. 6.2 google_admanager.module \_google_admanager_clean_string()

Internal function to "clean" a string to use as an attribute

2 calls to _google_admanager_clean_string()
google_admanager_add_term_attribute in ./google_admanager.module
Re-usable function for adding term attributes
google_admanager_node_view in ./google_admanager.module
Implements hook_node_view().

File

./google_admanager.module, line 510

Code

function _google_admanager_clean_string($string, $length = 40) {
  return drupal_substr(preg_replace('/[^a-z0-9]+/', '-', drupal_strtolower($string)), 0, $length);
}