【发布时间】:2017-02-22 00:08:06
【问题描述】:
我有以下字符串作为 PHP 变量。
<div class="entry-content-asset">
<div class="embed">
<iframe width="500" height="281" src="https://www.youtube.com/embed/DSP_yxvRZOA?feature=oembed" frameborder="0" allowfullscreen></iframe>
</div>
</div>
我需要以编程方式搜索此字符串并仅找到视频 ID DSP_yxvRZOA
每次保存 youtube 视频 ID 时,字符串都是相同的。我写正则表达式很糟糕,有人能救我吗?
【问题讨论】: