You are here

function search_autocomplete_replaceArguments in Search Autocomplete 6.2

Same name and namespace in other branches
  1. 7.3 search_autocomplete.module \search_autocomplete_replaceArguments()

+ * HELP FUNCTION: replace placeholders in the input string + *

Parameters

$input the string to be replaced: + * @param $args the array of placeholders and values +

1 call to search_autocomplete_replaceArguments()
search_autocomplete_init in ./search_autocomplete.module
HOOK OF INIT: add autocomplete.js on everypage

File

./search_autocomplete.module, line 121

Code

function search_autocomplete_replaceArguments(&$input, &$args) {
  $modified = FALSE;
  foreach ($args as $key => $data) {
    $input = preg_replace('#' . $key . '#', $data, $input);
    $modified = TRUE;
  }
  return $modified;
}