Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
将您的正则表达式更改为不贪婪:添加 U 修饰符。
$pattern = '~<a(.*)>(.*)</a>~U';
应该可以满足您的需求。