asNtext() public méthode

Formats the value as an HTML-encoded plain text with newlines converted into breaks.
public asNtext ( string $value ) : string
$value string the value to be formatted.
Résultat string the formatted result.
Exemple #1
0
 public function testAsNtext()
 {
     $value = '123';
     $this->assertSame($value, $this->formatter->asNtext($value));
     $value = 123;
     $this->assertSame("{$value}", $this->formatter->asNtext($value));
     $value = '<>';
     $this->assertSame('&lt;&gt;', $this->formatter->asNtext($value));
     $value = "123\n456";
     $this->assertSame("123<br />\n456", $this->formatter->asNtext($value));
     // null display
     $this->assertSame($this->formatter->nullDisplay, $this->formatter->asNtext(null));
 }