php - utf8_(en|de)code 从 php7 中删除?

标签 php utf-8 mbstring

我最近在我的开发服务器上切换到 PHP 7,它运行良好 - 直到现在。

自从我更新到 PHP 7.0.3-10+deb.sury.org~trusty+1(今天早些时候),utf8_decodeutf8_encode 函数不再可访问。但是,它们在 PHP7 的早期版本中。调用时,会引发 fatal error 。

我读到这些函数是由 mbstring 扩展提供的,我检查了 var_dump(extension_loaded('mbstring')); 是否已加载。

我怎样才能让上述功能再次工作?

最佳答案

我遇到了同样的问题。只需安装 php7.0-xml 包。 Ubuntu 16.04:

sudo apt-get install php7.0-xml

编辑:重新启动 apache2 以加载新包。

关于php - utf8_(en|de)code 从 php7 中删除?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35701730/

相关文章:

javascript - Rails 5 中 JavaScript 编码 apostope 的问题

python - 为什么我不能解码这个 UTF-8 页面?

c - 如何将 char* 转换为 UTF-8 编码的 char*?

php - 包括我自己的 mb_string 函数还是使用 PHP 的默认值?

PHP artisan key :generate does not update . env 文件(AWS EC2 Ubuntu 上的 laravel 5.2)

php - 具有不同结构和布局的页面模块?

php - 使用php下载文件时无法浏览网站

php://input 返回空字符串

php mb_convert_case() 保留大写的单词

Ubuntu 20.04、PHP 7.4 : mbstring installed but not enabled