Computer >> Computer tutorials >  >> Programming >> PHP

stripslashes() function in PHP


The stripslashes() function is used to un-quote a quoted string.

Syntax

stripslashes(str)

Parameters

  • str − Specify the string.

Return

The stripslashes() function returns a string with backslashes stripped off i.e '\' becomes '. The double backslashes (\\) are form into a single backslash (\).

Example

The following is an example −

<?php
   $mystr = "Tom\ Hanks";
   echo stripslashes($mystr);
?>

Output

The following is the output −

Tom Hanks