What role does the Content-Type header play in ensuring proper encoding and displaying of special characters in PHP when working with CSV files?
The Content-Type header specifies the media type of the resource being sent to the browser. When working with CSV files in PHP that contain special characters, setting the Content-Type header to 'text/csv; charset=utf-8' ensures that the special characters are properly encoded and displayed in the browser.
header('Content-Type: text/csv; charset=utf-8');