如果您的输入确实已知,那么您可以使用str_replace()例如$input = 'Enjoy your tea in the morning then have some bread in the lunch. Enjoy the taste of a garlic chicken in the dinner.Your day starts with cold coffee. In the noon have some rice and fish curry.';$old = array('Enjoy your ', ' then have ', '. Enjoy the taste of a ', 'Your day starts with ', '. In the noon have ');$new = array('Have ' , '. Have ' , '. Enjoy ' , 'Have ' , '. Have ' );$output = str_replace($old, $new, $input);请注意区分大小写以及空格、句点和其他标点符号。如果您的输入不太为人所知,那么您可以像您猜测的那样使用正则表达式。