What is the purpose of the highlightPhrase function in the provided PHP code?

The purpose of the highlightPhrase function in the provided PHP code is to search for a specific phrase within a given text and wrap it in an HTML tag for highlighting purposes. However, the current implementation of the function is not working correctly because it is not handling case sensitivity properly. To solve this issue, we need to modify the function to perform a case-insensitive search for the phrase within the text.

function highlightPhrase($text, $phrase) {
    $highlightedText = preg_replace('/\b' . preg_quote($phrase, '/') . '\b/i', '<span style="background-color: yellow;">$0</span>', $text);
    return $highlightedText;
}

// Example usage
$text = "This is a sample text to highlight a specific phrase.";
$phrase = "sample";
$highlightedText = highlightPhrase($text, $phrase);
echo $highlightedText;