# Highlighting Content

There are times when you may want to highlight certain words within your module page. One common use is to guide the user to occurrences of search terms in the display body. For this example, we assume you have an array of terms to highlight in *$words*, and some text (HTML is fine) in *$body*.

```php
$pre = '<span class=”highlight”>';
$post = '</span>';
\Xmf\Highlighter::apply($words, $body, $pre, $post);
```

Each occurrence of $words in $body will be surrounded by $pre and $post. If you do not specify the *$pre* and *$post* arguments, the terms will be surrounded by `<strong>` and `</strong>` tags.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xoops.gitbook.io/xmf-cookbook/recipes/highlighting-content.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
