PicoFeed\Filter\Tag::removeMultipleBreakTags PHP Method

removeMultipleBreakTags() public method

Replace

by only one.
public removeMultipleBreakTags ( string $data ) : string
$data string Input data
return string
    public function removeMultipleBreakTags($data)
    {
        return preg_replace("/(<br\\s*\\/?>\\s*)+/", '<br/>', $data);
    }

Usage Example

Beispiel #1
0
 /**
  * Called after XML parsing.
  */
 public function postFilter()
 {
     $this->output = $this->tag->removeEmptyTags($this->output);
     $this->output = $this->filterRules($this->output);
     $this->output = $this->tag->removeMultipleBreakTags($this->output);
     $this->output = trim($this->output);
 }