rss-bridge/formats/PlaintextFormat.php

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
492 B
PHP
Raw Normal View History

2013-08-11 15:30:41 +04:00
<?php
class PlaintextFormat extends FormatAbstract
{
const MIME_TYPE = 'text/plain';
public function stringify()
{
$data = [];
foreach ($this->getItems() as $item) {
$data[] = $item->toArray();
}
$text = print_r($data, true);
// Remove invalid non-UTF8 characters
ini_set('mbstring.substitute_character', 'none');
$text = mb_convert_encoding($text, $this->getCharset(), 'UTF-8');
return $text;
}
}