如何从字符串中删除斜杠?
问题描述:
我正在尝试做一些PHP编程概念,但是我不知道某些内置函数.所以我的疑问是:
I am trying to do some PHP programming concepts and I am not aware of some in-build functions. So my doubt is:
在PHP中,如何从字符串中删除斜杠? PHP中有为此提供的任何功能吗?
In PHP, how to remove slashes from strings? Is there any function available in PHP for this??
例如
$string="people are using Iphone/'s instead of Android phone/'s";
答
您可以使用stripslashes()函数.
You can use stripslashes() function.
<?php
$str = "Is your name O\'reilly?";
// Outputs: Is your name O'reilly?
echo stripslashes($str);
?>