Current Location: Home> Function Categories> quotemeta

quotemeta

Escape metacharacter set
Name:quotemeta
Category:String
Programming Language:php
One-line Description:Quoting metacharacters.

Definition and usage

quotemeta() function adds a backslash before some predefined characters in the string.

Predefined characters:

  • period(.)
  • Backslash (\)
  • Plus sign (+)
  • Asterisk (*)
  • question mark(?)
  • Square brackets ([])
  • Off-font size (^)
  • Dollar Sign ($)
  • Braces (())

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

Note: This function is binary safe.

grammar

 quotemeta ( string )
parameter describe
string Required. Specifies the string to be checked.
Similar Functions
  • Return part of the string substr

    substr

    Returnpartofthestrin
  • Alias ​​of strstr strchr

    strchr

    Alias​​ofstrstr
  • Returns information about the characters used in the string - counts the number of times each byte value (0..255) occurs in a string count_chars

    count_chars

    Returnsinformationab
  • Use another string to fill a string to a length str_pad

    str_pad

    Useanotherstringtofi
  • Comparison of strings based on locale settings strcoll

    strcoll

    Comparisonofstringsb
  • Returns the formatted string sprintf

    sprintf

    Returnstheformatteds
  • Set the first character of the string to lowercase lcfirst

    lcfirst

    Setthefirstcharacter
  • Convert binary data to hexadecimal representation bin2hex

    bin2hex

    Convertbinarydatatoh
Popular Articles