Php 使用str_replace删除字符串中的utf-8文本
我试图删除stirng中的UTF-8链接Php 使用str_replace删除字符串中的utf-8文本,php,str-replace,Php,Str Replace,我试图删除stirng中的UTF-8链接 $old = array("سایت (english) :"); $new = array(''); $string = str_replace($old, $new, $string); 但是没有成功…有人能告诉我我的错误吗 注意:我可以删除纯非英语或纯英语,但不能在一个文本中同时删除这两种语言 $string = mb_convert_encoding ($string, 'UTF-8'); $ol
$old = array("سایت (english) :");
$new = array('');
$string = str_replace($old, $new, $string);
但是没有成功…有人能告诉我我的错误吗
注意:我可以删除纯非英语或纯英语,但不能在一个文本中同时删除这两种语言
$string = mb_convert_encoding ($string, 'UTF-8');
$old = array (mb_convert_encoding ("سایت (english) :", 'UTF-8'));
$new = array ('');
$string = str_replace ($old, $new, $string);
您的输入字符串是什么?旧文本!我准确地将文本发送到函数,它将返回旧文本…没有任何更改