0

製品のインポート プラグインを使用します。製品は xml ファイルから (URL によって) インポートされます。1 つの xml ファイルには、タイトルに次の文字列が含まれています。

< product_title >
< ![CDATA[
< font color=red >All cities:< /font > Lorem Ipsum is simply dummy text of the printing and typesetting industry. !
]] >
< /product_title >

これをタイトルから削除する機能は何ですか: < font color=red > .. < /font >
(エンコードなしでそのまま表示されます)

どうもありがとう、ステイシス

4

1 に答える 1

1

strip_tags()PHPで使えます。

<title><?php echo strip_tags($title); ?></title>

<h1 class="page-title"> <?php if (strlen($btp_title) > 160) { $btp_title = substr($btp_title, 0, 160).'...'; } echo esc_html( $btp_title ); ?> </h1>

になるだろう

<h1 class="page-title"> <?php if (strlen($btp_title) > 160) { $btp_title = substr($btp_title, 0, 160).'...'; } echo strip_tags( esc_html( $btp_title ) ); ?> </h1>
于 2013-04-22T10:26:08.160 に答える