把字符串 "Hello world!" 中的字符 "world" 替換為 "Shanghai": <?php echo str_replace("world","Shanghai","Hello world!"); ?>