我有以下2个变量/字符串:
$article = ('Perfume is a mixture of fragrant word1 and aroma complexes, which can be applied to the human body, animals, word2, objects, and living spaces in order to give off a pleasant word3.');
$words = '{word1|word2|word3|word4|word5}';
我需要做的是在 $article 中搜索 $word 中的任何单词,如果找到的话,将在 $article 中找到的单词随机替换为从 $word 中随机挑选的单词。
请问我该怎么做?