You are here

function _xbbcode_parse_attrs in Extensible BBCode 7

Same name and namespace in other branches
  1. 8 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 ./xbbcode.filter.inc

File

./xbbcode.inc, line 162
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;
}