次のような文字列があります。
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);