- Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
- some text <img src="http://example.com/_data/025_img.jpg" border="0" /> more text
<?php
$text = 'some text [img:http://example.com/_data/025_img.jpg] more text';
echo preg_replace(
'~\[img:\s*(https?://example\.com(?:/\w+)*\.(?:jpe?g|png|gif))]~',
'<img src="$1" border="0" />',
$text
);