我有一个这样的字符串:
[img]http://placehold.it/350x150[/img] [img]http://placehold.it/350x250[/img]
我想获取实际链接并将其放入 img
<img src="http://placehold.it/350x150" /> <img src="http://placehold.it/350x250" />
我可能可以用这个创建一个组:[img](.*)[/img]
但我不确定如何在 php 中替换它。
形成另一个观点我冷做一个简单的字符串替换几次并替换
[img] with <img src=" and [/img] with " />
我不确定女巫是更好的选择
我也在尝试做同样的事情[video]http://www.youtube.com/watch/?v=lzBxqBsEIlE[/video]
有任何想法吗?
谢谢