What is the PHP function used to convert special characters like umlauts to their HTML entity form?

When working with special characters like umlauts in PHP, it is important to convert them to their HTML entity form to ensure proper rendering on web pages. This can be done using the `htmlspecialchars()` function in PHP, which converts special characters to their corresponding HTML entities. By using this function, you can safely display special characters without encountering encoding issues.

// Example PHP code to convert special characters like umlauts to HTML entities
$text = "Möglichkeiten für ändern";
$encoded_text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
echo $encoded_text;