如何从字符串中删除斜杠? [英] How can I remove slashes from strings?
本文介绍了如何从字符串中删除斜杠?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试做一些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);
?>
这篇关于如何从字符串中删除斜杠?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文