function MessagesAlter::match in Custom Submit Messages 7.x
Same name and namespace in other branches
- 7 messages_alter/lib/MessagesAlter.7.x-1.3.php \MessagesAlter::match()
Matches a regex that you provide.
Return value
ARRAY if the messages matches your regex FALSE when no match
File
- messages_alter/
lib/ MessagesAlter.6.x-1.3.php, line 62 - Contains the MessagesAlter class
Class
- MessagesAlter
- Defines the MessagesAlter class.
Code
function match($regex, $type = 'all') {
$matches = array();
$has_match = FALSE;
$types = $this
->getTypes($type);
foreach ($types as $t) {
if ($match = $this
->matchByType($t, $regex)) {
$matches[$t] = $match;
$has_match = TRUE;
}
}
return $has_match ? $matches : FALSE;
}