Answer the question
In order to leave comments, you need to log in
How to hide a domain?
I have a task to hide the full domain name by mask.
for example
https://toster.ru -> https://t***r.ru
http://google.com -> http://g***e.com
Answer the question
In order to leave comments, you need to log in
preg_replace('/^(https?:\/\/.).*(.\..*)$/','\1***\2', 'http://google.com');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question