.
Divya
In PHP the addcslashes() function is used to add backslashes in front of the specified characters.
NoteThe addcslashes() function is case-sensitive.
addcslashes(string,characters)
<!DOCTYPE html>
<html>
<body>
<?php
$str = "Welcome to students tutorial!";
echo $str."
";
echo addcslashes($str,'s')."
";
echo addcslashes($str,'t')."
";
?>
</body>
</html>
Welcome to students tutorial!
Welcome to \student\s tutorial!
Welcome \to s\tuden\ts \tu\torial!
.