标签: php regex
我在变量中有html代码:
$html = '<html> <a href="http://example.com/extnu/111"></a> <a href="http://example.com/extnu/222"></a> </html>';
如何搜索/extnu/并找到包含该词的第一个URL?所以结果应该是 http://example.com/extnu/111;
/extnu/
http://example.com/extnu/111