PHP Function Reference

PHP stripcslashes() Function



The PHP stripcslashes() function removes backslashes added by the addcslashes() function. This function recognizes C-like \n, \r ..., octal and hexadecimal representation.

Syntax

stripcslashes(string)

Parameters

string Required. Specify the string to be unescaped.

Return Value

Returns the unescaped string.

Example:

The example below shows the usage of stripcslashes() function.

<?php
$str = 'John loves \"Programming\"';

//returns: John loves "Programming"
echo stripcslashes($str)."\n";
?>

The output of the above code will be:

John loves "Programming"

Example:

Consider one more example on stripcslashes() function.

<?php
$str = "John\'s A/C number is:\n\'1234\'";

//returns: John's A/C number is:\n'1234'
echo stripcslashes($str);
?>

The output of the above code will be:

John's A/C number is:
'1234'

❮ PHP String Reference