Home >> PHP >> addslashes() function in PHP

addslashes() function in PHP

Returns a string with backslashes before predefined characters.

Syntax

addcslashes(string)

Predefined chracters

Single quote(')
Double quote(")
Backslash(\)
NULL

Example

$string="Hello's Raj";
echo addslashes($string);

Output

Hello\'s Raj

Post Your Comment

Next Questions
chunk_split() function
crc32() function
explode() function
implode() function
join() function
ltrim() function
md5() function
metaphone() function
money_format() function
nl2br() function
number_format() function
ord() function
parse_str() function
printf() function
quotemeta() function
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

Copyright ©2022 coderraj.com. All Rights Reserved.