<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kikiki-kiki</author_name>
  <author_url>https://blog.hatena.ne.jp/kikiki-kiki/</author_url>
  <blog_title>かもメモ</blog_title>
  <blog_url>https://chaika.hatenablog.com/</blog_url>
  <categories>
    <anon>PHP</anon>
    <anon>HTML</anon>
  </categories>
  <description>aタグで囲っているコンテンツの中に、管理画面のWYSIWYGエディターなどでユーザーが入力したHTMLのを出力する時、出力するHTMLの中にaタグが含まれていると、リンクが壊れてしまいます。 [参考] なので、aタグだけを除去して出力したい！ PHPではstrip_tagsという関数でHTMLのタグを除去できるのですが、この関数は許可するタグ(取り除かないタグ)は第二引数で選択できるのですが、特定のタグだけを除去したい場合はちょっと大変です。 preg_replace でaタグだけ除去する。 正規表現を使いますよね。。。苦手 aタグとaタグで囲まれている文字列を消去 &lt;?php // 入力され…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fchaika.hatenablog.com%2Fentry%2F2016%2F07%2F11%2F165333&quot; title=&quot;PHP aタグだけ除去したい。 - かもメモ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>http://ecx.images-amazon.com/images/I/51gLSSmCnjL.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2016-07-11 16:53:33</published>
  <title>PHP aタグだけ除去したい。</title>
  <type>rich</type>
  <url>https://chaika.hatenablog.com/entry/2016/07/11/165333</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
