<?php $str = 'value 12; another value; yet one more one; val5'; $src = ["value 12", "another value", "yet one more one", "val5"]; $tgt = ["red","green","blue","violet"]; $res = str_replace($src, $tgt, $str); echo $res;
You have javascript disabled. You will not be able to edit any code.