As in the official documentation say: https://www.php.net/utf8_encode
This function has been DEPRECATED as of PHP 8.2.0. Relying on this function is highly discouraged.
I recommend you to change by
$enconded = iconv('ISO-8859-1', 'UTF-8', $value);
Or use other way to encoded (depending on your php version) as this answer recommend: PHP utf8_en/decode deprecated, what can i use?