htmlEnt() public static method

Convert >, <, ', " and & to html entities, but preserves entities that are already encoded.
public static htmlEnt ( string $string, boolean $encodedEntities = false ) : string
$string string The text to be converted
$encodedEntities boolean
return string
Exemplo n.º 1
0
 /**
  * @param $string
  * @return string
  */
 public static function html($string)
 {
     return Str::htmlEnt($string);
 }
Exemplo n.º 2
0
 public function testHtmlentities()
 {
     is('One &amp; Two &lt;&gt; &amp;mdash;', Str::htmlEnt('One & Two <> &mdash;'));
     is('One &amp; Two &lt;&gt; &mdash;', Str::htmlEnt('One &amp; Two <> &mdash;', true));
 }