escXml() public static method

Escape string before save it as xml content
public static escXml ( $string ) : mixed
$string
return mixed
コード例 #1
0
ファイル: Filter.php プロジェクト: jbzoo/utils
 /**
  * @param $string
  * @return string
  */
 public static function xml($string)
 {
     return Str::escXml($string);
 }
コード例 #2
0
ファイル: StringTest.php プロジェクト: jbzoo/utils
 public function testEscXML()
 {
     isSame('&lt;a href=&quot;/test&quot;&gt;Test!@#$%^&amp;*()_+\\/&lt;/a&gt;', Str::escXml('<a href="/test">Test!@#$%^&*()_+\\/</a>'));
 }