<div class="content2 left">
<p class="box1"><b>你好</b>你好</p>
<p class="box2"><span>欢迎光临</span> 这里是要截取的文字.
</p>
</div>
</div>
------解决方案--------------------
- PHP code
<?php$html=<<<HTML<div class="content2 left"><p class="box1"><b>你好</b>你好</p><p class="box2"><span>欢迎光临</span> 这里是要截取的文字.</p></div></div>HTML;preg_match_all('/<p class="box2"><span>(.*)<\/span>(.*)<\/p>/s',$html,$matches);print_r($matches);