function heartbeat_match_variables in Heartbeat 6.4
Same name and namespace in other branches
- 6.3 heartbeat.common.inc \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)
1 call to heartbeat_match_variables()
- heartbeat_rule_action_get_variables in modules/
heartbeat_rules/ hrules.module - Helper function to fetch the defined variables for this message
File
- modules/
heartbeat_rules/ hrules.module, line 209 - Heartbeat rules implementation module
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;
}