What are the best practices for setting the character encoding in PHP when sending form data via POST method?

When sending form data via POST method in PHP, it is important to set the character encoding properly to ensure that special characters are handled correctly. The best practice is to set the character encoding to UTF-8, which supports a wide range of characters and is widely used on the web.

// Set character encoding for form data sent via POST method
header('Content-Type: text/html; charset=utf-8');