Easy Tutorial
❮ Func Filesystem Is Writable Func Date Mktime ❯

PHP quotemeta() Function

PHP String Reference Manual

Example

Adding backslashes before predefined characters:


Definition and Usage

The quotemeta() function adds backslashes before certain predefined characters in a string.

Predefined characters:

Tip: This function can be used to escape characters that have special meanings, such as ( ) , [ ] , and * in SQL.

Note: This function is binary-safe.


Syntax

Parameter Description
string Required. Specifies the string to be checked.

Technical Details

Return Value: Returns the string with meta characters quoted.
PHP Version: 4+
--- ---

More Examples

Example 1

Adding backslashes before multiple predefined characters:


❮ Func Filesystem Is Writable Func Date Mktime ❯