How can native smileys be properly handled in PHP scripts?

Native smileys in PHP scripts can be properly handled by ensuring that the character encoding is set to UTF-8 and using the `mb_convert_encoding` function to convert the smiley characters to HTML entities before displaying them on the webpage.

// Set the character encoding to UTF-8
header('Content-Type: text/html; charset=utf-8');

// Convert native smileys to HTML entities
$smiley = '😊';
$smiley_html = mb_convert_encoding($smiley, 'HTML-ENTITIES', 'UTF-8');

echo $smiley_html;