Home >Backend Development >PHP Tutorial >Use substr_replace in PHP to replace characters between two specified positions with symbols

Use substr_replace in PHP to replace characters between two specified positions with symbols

PHP中文网
PHP中文网Original
2016-07-29 08:44:221185browse

Copy the code The code is as follows:


$username = "zongzi";
echo substr_replace($username,'**','1','2');

The above introduces the use of substr_replace in PHP Replace the characters between the two specified positions with numbers, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn