Search Results
Return Values ¶ Returns the string with meta characters quoted, or false if an empty string is given as string.
Definition and Usage The quotemeta () function adds backslashes in front of some predefined characters in a string. The predefined characters are: period (.) backslash (\) plus sign (+) asterisk (*) question mark (?) brackets ( []) caret (^) dollar sign ($) parenthesis ( ()) Tip: This function can be used to escape characters with special meanings, such as ( ), [ ], and * in SQL. Note: This ...
Jul 11, 2025 · The quotemeta () function is an inbuilt function in PHP which accepts a string as an argument and returns a string which has backslashes added in front of some predefined characters in a string.
La fonction quotemeta () est un outil utile pour travailler avec les expressions régulières en PHP. Elle permet d'échapper les caractères métas dans une chaîne, ce qui est pratique pour diverses opérations comme la correspondance et la substitution dans les expressions régulières.
# quotemeta EXPR # quotemeta Returns the value of EXPR with all the ASCII non-"word" characters backslashed. (That is, all ASCII characters not matching /[A-Za-z_0-9]/ will be preceded by a backslash in the returned string, regardless of any locale settings.) This is the internal function implementing the \Q escape in double-quoted strings. (See below for the behavior on non-ASCII code points ...
Découvrez la fonction quotemeta() de PHP pour échapper automatiquement les méta-caractères spéciaux dans vos chaînes. Guide complet avec exemples pratiques et cas d'usage pour sécuriser vos expressions régulières.
La fonction quotemeta échappe les caractères spéciaux dans une chaîne avec une barre oblique inversée. Examinons son fonctionnement à travers des exemples.
