escape() public static method

The parameter $all is boolean flag that, when set to true, causes the '%' and '_' characters to be escaped as well.
public static escape ( string $string, boolean $all = false ) : string
$string string
$all boolean
return string
Esempio n. 1
0
 public function testEscape()
 {
     $this->assertEquals("\\\\\\n\\r\\x00\\x1a\\'\\\"\\%\\_", String::escape("\\\n\r'\"%_", true));
 }