3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = "{download='text for buttonzzzz'} HAHA! {download='test'}"; preg_match_all("/{download='(.*?)'}/", $string, $matches, PREG_SET_ORDER); foreach ($matches as $val) { $string = str_replace("{download='" . $val[1] . "'}", "<a class=\"button\">" . $val[1] . "</a>", $string); } echo $string;
Output for 4.3.0 - 7.2.0
<a class="button">text for buttonzzzz</a> HAHA! <a class="button">test</a>