Home >> PHP >> quotemeta() function in PHP

quotemeta() function in PHP

Add backslashes in before predefined characters in a string.

Predefined Characters

. \ + * ? [ ^ ] ( $ )

Syntax

quotemeta(string)

Example

$str = "Hello Dear. (How are you?)";
echo quotemeta($str);

Output

Hello Dear\. \(How are you\?\)

Post Your Comment

Next Questions
rtrim() function
sha1() function
sha1_file() function
similar_text() function
str_ireplace() function
str_pad() function
str_repeat() function
str_replace() function
str_shuffle() function
str_split() function
str_word_count() function
strcasecmp() function
strchr() function
strcmp() function
strcspn() function
strip_tags() function
stripslashes() function
stripos() function
stristr() function
strlen() function
strnatcasecmp() function
strnatcmp() function
strncasecmp() function
strncmp() function
strpbrk() function

Copyright ©2022 coderraj.com. All Rights Reserved.