str_replace is widely used for replacing a word or a single character in PHP. But if you want to replace multiple words at a time, then you can place them in an array and replace them using str_replace function. Here is the usage:
Replace Multiple Words with a Single Word with str_replace:
Replacing array of words with a single word in PHP
PHP
1
2
3
4
5
6
<?php
$string="This is a long string containing a full list of short words";