You are here

private static function XBBCodeTagMatch::parseAttrs in Extensible BBCode 8.2

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 XBBCodeTagMatch::parseAttrs()
XBBCodeTagMatch::__construct in src/XBBCodeTagMatch.php

File

src/XBBCodeTagMatch.php, line 51

Class

XBBCodeTagMatch

Namespace

Drupal\xbbcode

Code

private static function parseAttrs($string) {
  preg_match_all('/' . XBBCODE_RE_ATTR . '/', $string, $assignments, PREG_SET_ORDER);
  $attrs = [];
  foreach ($assignments as $assignment) {
    $attrs[$assignment['key']] = $assignment['value'];
  }
  return $attrs;
}