You are here

function heartbeat_match_variables in Heartbeat 6.3

Same name and namespace in other branches
  1. 6.4 modules/heartbeat_rules/hrules.module \heartbeat_match_variables()

Function looks for variables in an array of given strings

@remark %targetnames% do not have to be tokenized

Return value

array of words and variables found (separately stored)

2 calls to heartbeat_match_variables()
heartbeat_rules_default_action_form in ./heartbeat.rules.inc
Action drupal message configuration form.
heartbeat_rules_users_action_form in ./heartbeat.rules.inc
User action drupal message configuration form.

File

./heartbeat.common.inc, line 102
Commonly functions used in heartbeat

Code

function heartbeat_match_variables() {
  $args = func_get_args();
  $string = '';
  $string .= implode(' ', array_values($args));
  preg_match_all("/\\!([a-zA-Z0-9_]+)/", $string, $matches);
  $words = $matches[1];
  $variables = $matches[0];
  $found = array(
    'words' => $words,
    'variables' => $variables,
  );
  return $found;
}