- var_export: documentation ( source)
- preg_replace: documentation ( source)
<?php
$comment = "@name kdfjd @@ fkjd as@name @ lkjlkj @name";
var_export(
preg_replace(
'/(?<=^| )@([^@ ]+)/',
'<a href="/$1">@$1</a>',
$comment
)
);