3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "This is a #hashtag within some #awesometext."; $newText = preg_replace("/#(\w+)/", "<a href='category.php?tag=$1'>#$1</a>", $text); echo $newText;

preferences:
37.56 ms | 402 KiB | 5 Q