我有一个像这样的字符串:
juices vegetables including {{smartpro=img:hippo-1.jpg,alt:abc,ht:217,wd:247,align:left}} wheatgrass, leafy greens, parsley, aloe vera & other herbs
现在这里{{smartpro=img:hippo-1.jpg,alt:abc,ht:217,wd:247,align:left}}
替换为
<img src="www.abc.com/media/images/hippo-1.jpg" alt="" width="247" height="217" align="left">
所以最终的字符串将是:
juices vegetables including <img src="www.abc.com/media/images/hippo-1.jpg" alt="abc" width="247" height="217" align="left"> wheatgrass, leafy greens, parsley, aloe vera & other herbs
请帮忙 。
我的尝试:preg_replace('~\{{\{{(.+)\:(.+)\}}\}}~iUs','<img src="$2">$1/>',$string);