I've a body of content that is read in and it contains numerous strings like `{{some_text}}` and what I'm trying to do is to find all these occurances and replace them with another value from an array for example `$text["some_text"]`.

I've tried using preg\_replace but not sure how I go about taking the found text between the brackets and use it in the replace value.

```
$body = "This is a body of {{some_text}} text from a book.";
$text["some_text"] = "really cool";
$parsedBody = preg_replace("\[{].*[}]/U", $text[""], $body);

```

As you can see I'm trying to get the `some_text`text out of the string and use it to call an element from an array, this example is very basic as there `$body`value is vastly larger and `$text`has a couple hundred elements too it.