html文字列からリンクを抽出する関数が必要です。 例:文字列からハイパーリンクを抽出するPHP関数
文字列:
<!-- BEGIN PARTNER PROGRAM - DO NOT CHANGE THE PARAMETERS OF THE HYPERLINK -
-> <a href='http://www.link.com' target='_blank'>text</a> <img
src='http://www.linkimage.com' BORDER='0' WIDTH='1' HEIGHT='1' /> <!-- END
PARTNER PROGRAM -->
を抽出する必要があります:
http://www.link.com
Thxを
https://www.mkyong.com/regular-expressions/how-to-extract-html-links-with-regular-expression/ – mic
「あなたは何を試しましたか、どこに止まっていますか?質問...ヒント:[RegExp](https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454)を使用しないでください。 [DOMDocument](http://php.net/manual/en/class.domdocument.php) – CD001