function _xbbcode_parse_attrs in Extensible BBCode 8
Same name and namespace in other branches
- 7 xbbcode.inc \_xbbcode_parse_attrs()
Parse a string of attribute assignments.
Parameters
$string: The string containing the arguments, including initial whitespace.
Return value
An associative array of all attributes.
1 call to _xbbcode_parse_attrs()
- XBBCodeTagMatch::__construct in lib/
Drupal/ xbbcode/ XBBCodeTagMatch.php
File
- ./
xbbcode.inc, line 164 - General library of internal functions only called by this module.
Code
function _xbbcode_parse_attrs($string) {
preg_match_all('/' . XBBCODE_RE_ATTR . '/', $string, $assignments, PREG_SET_ORDER);
$attrs = array();
foreach ($assignments as $assignment) {
$attrs[$assignment['key']] = $assignment['value'];
}
return $attrs;
}