PHP quotemeta() Function
The quotemeta()
is an in-built function of PHP,is used to adds backslashes before some predefined characters in a string.
- Period Plus (.)
- backslash (\)
- Plus(+)
- Asterisk (*)
- Question mark (?)
- Square Brackets ([])
- Caret (^)
- Dollar ($)
- Parenthesis (())
Syntax
quotemeta(string)
- string - (Required) Specify the string to check.
Example
<?php $a = "Hello Students. (please listen me.)"; echo quotemeta($a); ?>
Output
Hello Students\. \(please listen me\.\)