3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $my_string = "newtext!234@@random_text@@weludud"; $replace = 'replaced_text'; $replaced_text = preg_replace('#(@)(.*)(@)#si', "$1$replace$3", $text); echo $replaced_text;
based on vjQMs
Output for 5.0.4 - 7.1.0
Notice: Undefined variable: text in /in/cffsU on line 4
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: text in /in/cffsU on line 4