Your question is not very clear, sorry, but I think what you want is this:
$replacedText = preg_replace('/{osoba_odpowiedzialna}/',
$collection['osoba_odpowiedzialna'], $value);
//this will yield (last line below)
//Osoba odp.: ?ukasz Moderator
After your comments:
$collection->map(function($item, $key) use (&$value){ //$collection->each(.. should also be fine
$value = preg_replace('/{'.$key.'}/', $item, $value);
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…