Reputation: 392
I have some problems with the fottowing code:
echo preg_replace('/^([@\.]*)$/i', '<span>$1</span>', "[email protected]");
I want to get example<span>@</span>mail<span>.</span>com"
, but with $1
I'm not getting the value I need... any help?
Upvotes: 0
Views: 24
Reputation: 7769
Try this, it works
echo preg_replace('/([@\.])/i', '<span>$1</span>', "[email protected]");
Upvotes: 3