0
因此,这里是我的代码:str_replace不工作 - 为什么会发生这种情况?
function csq($string)
{
$search = array(chr(145),
chr(146),
chr(147),
chr(148),
chr(151),
chr(149),
"•");
$replace = array("'",
"'",
'"',
'"',
'-',
'•',
'•');
return str_replace($search, $replace, $string);
}
$username = csq($_POST["username"]);
$titletag = csq($_POST["titletag"]);
$keywordtag = csq($_POST["keywordtag"]);
$desctag = csq($_POST["desctag"]);
$content = csq($_POST["content"]);
据我所知,每个变量应采取指定名称的变量后,再传递到CSQ()函数,它会替换特殊字符。
这没有发生。我写错了什么?
这里有一个字符串:
• Went over key word list that was generated
o Ant1 highlighted approved words
o We should add a column to calculate the ratio between the number of queries vs. the number of results “in parenthesis”
你能提供一个'$ string'不你打算怎么办? –
在其中例如140-155范围内没有字符,所以没有什么可以替代 –
“并且子弹应该都在字符串内。 –