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.