html
1<input class="sample" type="hidden" value="<a href="http://example.com/">http://example.com/</a>"> 2
このhtmlをphpで
HTML
1<input class="sample" type="hidden" value="<a href='http://example.com/'>http://example.com/</a>">
このように変換したいのです。aタグのhref属性の値のみシングルクォーテーションに変換したいのです。
preg_replace関数を使って置換したいのですが、どのようにすればよいでしょうか?
回答1件
あなたの回答
tips
プレビュー