Web ページに次のHTMLがあります。
<p>This is a <a href="http://www.google.com/">hyperlink</a> and this is another <a href="http://www.bing.com/">hyperlink</a>. There are many like it, but <a href="http://en.wikipedia.org/wiki/Full_Metal_Jacket">this one is mine</a>.</p>
さて、ふと思ったのですが…
PHP 関数を使用して、このテキスト ブロックを配列に分割する方法はありますか?
$html[0] = "<p>This is a & this is another . There are many like it, but .</p>";
$html[1] = "http://www.google.com/";
$html[2] = "http://www.bing.com/";
$html[3] = "http://en.wikipedia.org/wiki/Full_Metal_Jacket";
したがって、基本的にすべてのハイパーリンクのテキストの最初のブロックを取り除き、それらすべてを独自の配列要素に格納します。
これについて何か助けてくれてありがとう。