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.
用正则表达式解析 HTML 不是一个好主意。有太多变数会导致事情变得混乱。
尽管如此:
<?php $scrr = "<em>Details</em>I want to <em>get</em>"; preg_match_all('/<em>(.+?)<\/em>/is', $scrr, $match); print_r($match); ?>