Kanika Kanika - 6 months ago 20
PHP Question

How can I remove slashes from strings?

I am trying to do some PHP programming concepts and I am not aware of some in-build functions. So my doubt is:

In PHP, how to remove slashes from strings? Is there any function available in PHP for this??

e.g.

$string="people are using Iphone/'s instead of Android phone/'s";

Answer

You can use stripslashes() function.

<?php
$str = "Is your name O\'reilly?";

// Outputs: Is your name O'reilly?
echo stripslashes($str);
?>
Comments