PHP str_replace array() 不工作? (有例子)
PHP str_replace with array() not working ? (have example)
[代码]
echo str_replace(array('(', ')'), '', "(test) i'm test"); exit;
[运行]
(test) i'm test
我想从此文本中删除括号,但它不起作用?
此代码从以下字符串中删除括号 (
、)
:
(test) i'm test"
$string = "(test) i'm test";
echo str_replace(array( '(', ')' ), '', $string);
使用str_replace()函数后的结果:
test i'm test"
[代码]
echo str_replace(array('(', ')'), '', "(test) i'm test"); exit;
[运行]
(test) i'm test
我想从此文本中删除括号,但它不起作用?
此代码从以下字符串中删除括号 (
、)
:
(test) i'm test"
$string = "(test) i'm test";
echo str_replace(array( '(', ')' ), '', $string);
使用str_replace()函数后的结果:
test i'm test"