1

My website has been running for a long time. Currently upgraded to php 5.6 and maria db 10.1.44. The utf8_encode function was used in a lot of php code. But now I have to remove it so the characters are output correctly. However, I can't edit a lot of php code ... Is there a way to invalidate the utf8_encode function? Or is it possible to override the php core function?

DongJin Oh
  • 109
  • 6

2 Answers2

1

Yes you could do so by making some changes in the php.ini file as

Disable PHP Functions

Kunal Raut
  • 2,495
  • 2
  • 9
  • 25
1

You could override utf8_encode() with function_override() but I can not recommend it.

Instead, you better fix the existing code yourself. When you use an IDE like Eclipse PDT, you can do a global search in all files and folders, and remove the calls to utf8_encode() rather quickly.

While PHP 5.6's default encoding has been changed to UTF-8, that version is already end-of-life: https://www.php.net/supported-versions.php. After moving up to 5.6, consider migrating your code to PHP 7.2 at least.

Code4R7
  • 2,600
  • 1
  • 19
  • 42