<?php $set = [ 'abc' => 'ABC', 'def' => 'DEF' ]; $text = 'abc aaa defr def'; foreach ($set as $key => $value) { $text = str_replace($key, $value, $text); } echo $text;
You have javascript disabled. You will not be able to edit any code.