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 −

 Live Demo

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

Output

The following is the output −

Tom Hanks

Samual Sam
Samual Sam

Learning faster. Every day.

Updated on: 26-Dec-2019

239 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements