Php 编码问题:iTunesXML

Php 编码问题:iTunesXML,php,arrays,xml,itunes,Php,Arrays,Xml,Itunes,我对iTunes上的播客描述中出现的一些HTML ascii代码有疑问。不幸的是,我不是伟大的PHP,但我正在尝试无论如何!我发现了一个章节,我相信是关于替换或剥离代码的 // iTunes summary does not allow any HTML and must be shorter than 4000 characters $itunes_summary = strip_tags( get_the_content() ); $itunes_summary = str_replace(

我对iTunes上的播客描述中出现的一些HTML ascii代码有疑问。不幸的是,我不是伟大的PHP,但我正在尝试无论如何!我发现了一个章节,我相信是关于替换或剥离代码的

// iTunes summary does not allow any HTML and must be shorter than 4000 characters
$itunes_summary = strip_tags( get_the_content() );
$itunes_summary = str_replace( array( '&', '>', '<', '\'', '"', '`' ), array( __( 'and', 'seriously-simple-podcasting' ), '', '', '', '', '' ), $itunes_summary );
$itunes_summary = mb_substr( $itunes_summary, 0, 3949 );

// iTunes short description does not allow any HTML and must be shorter than 4000 characters
$itunes_excerpt = strip_tags( strip_shortcodes( get_the_excerpt() ) );
$itunes_excerpt = str_replace( array( '&', '>', '<', '\'', '"', '`', '[andhellip;]', '[&hellip;]' ), array( 'and', '', '', '', '', '', '', '' ), $itunes_excerpt );
$itunes_excerpt = mb_substr( $itunes_excerpt, 0, 224 );
//iTunes摘要不允许任何HTML,必须少于4000个字符
$itunes\u summary=strip\u标签(获取内容());
$itunes\u summary=str\u replace(数组(“&”、“>”、“>

你解决了这个问题吗?写一个答案,如果是的话,把它标记为接受。
<description>
<![CDATA[
Post Father&#8217;s Day tea time on the DahlCast &#8211; What&#8217;s your fav? Lipton, Snapple or handle bar mustaches? Pet peeves raid today&#8217;s show as the guys talk flip flops, situational unawareness and open table plus the internet&#8217;s latest craze the Cheerio Challenge.
]]>
</description>
<itunes:subtitle>
<![CDATA[
Post Fatherand#8217;s Day tea time on the DahlCast and#8211; Whatand#8217;s your fav? Lipton, Snapple or handle bar mustaches? Pet peeves raid todayand#8217;s show as the guys talk flip flops, situational unawareness and open table plus the internetand#8
]]>
</itunes:subtitle>
<content:encoded>
<![CDATA[
<p>Post Father&#8217;s Day tea time on the DahlCast &#8211; What&#8217;s your fav? Lipton, Snapple or handle bar mustaches? Pet peeves raid today&#8217;s show as the guys talk flip flops, situational unawareness and open table plus the internet&#8217;s latest craze the Cheerio Challenge.</p>
]]>
</content:encoded>
<itunes:summary>
<![CDATA[
Post Father's Day tea time on the DahlCast &#8211; What's your fav? Lipton, Snapple or handle bar mustaches? Pet peeves raid today's show as the guys talk flip flops, situational unawareness and open table plus the internet's latest craze the Cheerio Challenge.
]]>
</itunes:summary>
<item>
        <title><?php esc_html( the_title_rss() ); ?></title>
        <link><?php esc_url( the_permalink_rss() ); ?></link>
        <pubDate><?php echo esc_html( mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ) ); ?></pubDate>
        <dc:creator><?php echo $author; ?></dc:creator>
        <guid isPermaLink="false"><?php esc_html( the_guid() ); ?></guid>
        <description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
        <itunes:subtitle><?php echo $itunes_excerpt; ?></itunes:subtitle>
        <content:encoded><![CDATA[<?php echo $content; ?>]]></content:encoded>
        <itunes:summary><?php echo $itunes_summary; ?></itunes:summary><?php if ( $episode_image ) { ?>
        <itunes:image href="<?php echo esc_url( $episode_image ); ?>"></itunes:image><?php } ?>
        <enclosure url="<?php echo esc_url( $enclosure ); ?>" length="<?php echo esc_attr( $size ); ?>" type="<?php echo esc_attr( $mime_type ); ?>"></enclosure>
        <itunes:explicit><?php echo esc_html( $explicit_flag ); ?></itunes:explicit>
        <itunes:block><?php echo esc_html( $block_flag ); ?></itunes:block>
        <itunes:duration><?php echo esc_html( $duration ); ?></itunes:duration>
        <itunes:author><?php echo $author; ?></itunes:author>
</item>