PHP quotemeta

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

PHP : quotemeta() function

Description

The quotemeta() function is used to add backslash character () before meta characters i.e. ' .', '', '+', '*', '?', '[', '^', ']',' (', '$', ')' in a string.

Version

(PHP 4 and above)

Syntax

quotemeta (input_string)

Parameter

Name

Description

Required /
Optional

Type

input_string

The input string.

Required

string

Return value

Returns the string with meta characters quoted.

Value Type : String.

Pictorial Presentation

php-string-quotemeta()

Example :

  1. $input_string = 'w3resource.com';  

  2. echo quotemeta($input_string);  

  3. ?>   

Output :

w3resource.com