items = array(); $matches = array(); $hits = preg_match_all($this->_regex, $text, $matches, PREG_SET_ORDER); if ($hits > 0) { foreach ($matches as $match) { $item = &$this->items[]; $tag = $match[1]; $item['entry'] = $tag; $item['display'] = str_replace('_', ' ', $tag); // swap '_' for spaces for display $item['section'] = $this->section; $item['type'] = $this->type; $item['star'] = $match[2] == '*' ? true : false; } return true; } else { return false; } } }