28 lines
348 B
PHP
28 lines
348 B
PHP
<?php
|
|
|
|
namespace App\Paper;
|
|
|
|
|
|
class HtmlToPos
|
|
{
|
|
|
|
|
|
private function handleNewLine($text)
|
|
{
|
|
return str_replace(['<br>', '<br/>', '<br />'], "\n", $text);
|
|
}
|
|
|
|
public function convert($html)
|
|
{
|
|
|
|
$posText = $this->handleNewLine($html);
|
|
|
|
|
|
// print_r($posText);
|
|
|
|
// die();
|
|
return $posText;
|
|
|
|
}
|
|
|
|
} |