我有一串这样的
$text_string = 'Every thing must be done in time. So,It is not a good thing to be
so late. What are the Rules of This Process are prominent in this
video [VIDEO]http://www.youtube.com/watch?v=yseAuiSl[/VIDEO]. So,
It will be more sensible if you watch a tutorial here
[VIDEO]http://www.dailymotion.com/video/xyxmu6_underwater[/VIDEO]
It is much more explanatory. These are the Rules of Thumb.'
我需要获取每个[VIDEO] .... [/VIDEO]
,然后将其传递给一个函数(我自己创建了该函数),该函数将其转换为其相应的嵌入代码,例如
[VIDEO]http://www.youtube.com/watch?v=yseAuiSl[/VIDEO]
将转换为
<iframe width="680" height="450" src="http://www.youtube.com/embed/yseAuiSl"
frameborder="0" allowfullscreen></iframe>
然后我需要[VIDEO] .... [/VIDEO]
用它的嵌入代码替换它。那么,我如何遍历整个字符串并逐个获取每个[VIDEO] ... [/VIDEO]
标签并在处理后将其替换为其嵌入代码?