Feed标题中的撇号会产生错误

时间:2015-11-11 09:38:57

标签: php special-characters feed

当我尝试生成Feed时,浏览器中的标题'被解释为浏览器会在字符处生成错误,MySql包含{ {1}}而不是'我尝试用PHP替换但不工作。

Browser

MySql

任何解决方案?

标题设置正确(我认为)

$domanda = mysqli_query($conn, "SELECT * FROM wp_posts WHERE post_status = 'publish' and post_type = 'post' AND DATE(post_modified) > DATE(post_date) ORDER BY post_modified DESC LIMIT 50");
    $numrss = mysqli_num_rows($domanda);
    while ($info = $domanda->fetch_array(MYSQLI_ASSOC))
    {
    $primodato=$info['post_title'];
    echo "<item>
    <title><![CDATA[".str_replace("'"," ",$primodato)."]]></title>";

0 个答案:

没有答案