A
A
alex steel2020-05-12 21:13:20
PHP
alex steel, 2020-05-12 21:13:20

How to replace part of a string with asterisks?

Good day
How can I replace part of the text in a string with asterisks?
For example
qwerty*****zxcvbn1234

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daria Motorina, 2020-05-12
@alexsteel07

$original = '1234567890';
echo substr_replace($original, '***', 3, 3);
//output: 123***7890

documentation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question