3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <h1>Or Any Other tags except img or nothing</h1> <span>stuff</span> <img src="{{media url=&quot;image_name.png&quot;}}" alt="image_test" /> <div>more stuff</div> <h1>Or Any Other tags except img or nothing</h1> HTML; function alterateContent(string $html, string $imageFileName, string $replacement): string { $imageFileName = preg_quote($imageFileName, '/'); return preg_replace("/<img\h+src=\"{{media url=&quot;{$imageFileName}&quot;}}\".*?\/>/", $replacement, $html); } echo alterateContent($html, 'image_name.png', '<b>Hi test</b>');
Output for git.master, git.master_jit, rfc.property-hooks
<h1>Or Any Other tags except img or nothing</h1> <span>stuff</span> <b>Hi test</b> <div>more stuff</div> <h1>Or Any Other tags except img or nothing</h1>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
138.86 ms | 405 KiB | 5 Q