I am trying to replace all values of array except one key value. I am using preg_replace
and have this code:
$posts = json_decode($post_list, true);
foreach($posts as &$elm){
$elm = array_map(function($i) use($s){
return preg_replace("/(" . preg_quote($s) . ")/is", "<span style='background: #92CF18;'>$1</span>", $i);
}, $elm);
}
My posts var looks like this: pastebin I want to don't change value of "slug" key how can I do it?