<?php $reg = '/=["\']img\/([^"\']*)["\']/';$src = 'Some text ="img/image-file1.jpg" another text ="img/file-2.png" other text ="img/image3.jpg" final text';$final = preg_replace($reg, '={{media url="wysiwyg/$1"}}', $src);echo $final;
Standard input is empty
Some text ={{media url="wysiwyg/image-file1.jpg"}} another text ={{media url="wysiwyg/file-2.png"}} other text ={{media url="wysiwyg/image3.jpg"}} final text
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!