In cases where changing the encoding to UTF-8 does not resolve special character display issues, what alternative methods or functions in PHP can be used to handle character encoding discrepancies?

Special character display issues in PHP can sometimes persist even after changing the encoding to UTF-8. In such cases, one alternative method to handle character encoding discrepancies is by using the `iconv()` function in PHP. This function can be used to convert strings between different character encodings, helping to ensure that special characters are displayed correctly.

// Example of using iconv() function to handle character encoding discrepancies
$originalString = "élégant"; // String with incorrect encoding
$correctString = iconv("ISO-8859-1", "UTF-8", $originalString); // Convert encoding to UTF-8
echo $correctString; // Output: élégant