每天进步1% 今天是2025-07-18本文发表于2017-8-31

php 字符串替换

把字符串 "Hello world!" 中的字符 "world" 替换为 "Shanghai":

  1. <?php 
  2. echo str_replace("world","Shanghai","Hello world!"); 
  3. ?>