3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = '{download} button {download="hello"} {download=\'hey\'} assa {download="asa"}'; $str = str_replace('{download}', '{download="Download"}', $str); $str = preg_replace( '/\{download(\=\"(.*)\"|\=\'(.*)\'|)\}/siU', '<a href="#" class="button">$2</a>', $str); echo $str; ?>
Output for 4.3.0 - 7.2.0
<a href="#" class="button">Download</a> button <a href="#" class="button">hello</a> <a href="#" class="button"></a> assa <a href="#" class="button">asa</a>