3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'say hello to @elise and @john'; function replace_at_symbol($matches){ return "".$matches[0].""; } $output = preg_replace_callback("/([@][a-zA-Z-0-9]+)/", "replace_at_symbol", $text); echo $output; ?>

preferences:
38.24 ms | 402 KiB | 5 Q