- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我目前正在编写一个 PHP 函数,但是在执行完整的脚本时出现错误:
错误:
Call to undefined function mb_convert_encoding()
我的功能:
function cleanData(&$str)
{
if($str == 't') $str = 'TRUE';
if($str == 'f') $str = 'FALSE';
if(preg_match("/^0/", $str) || preg_match("/^\+?\d{8,}$/", $str) || preg_match("/^\d{4}.\d{1,2}.\d{1,2}/", $str)) {
$str = "'$str";
}
if(strstr($str, '"')) $str = '"' . str_replace('"', '""', $str) . '"';
$str = mb_convert_encoding($str, 'ISO-8859-1','utf-8');
}
谁能看出我哪里出错了。非常感谢您的宝贵时间。
干杯
最佳答案
您需要安装 extension .这取决于您的操作系统,以下是一些示例:
sudo apt-get install php-mbstring # Debian, Ubuntu
sudo yum install php-mbstring # RedHat, Fedora, CentOS
关于php - mb_convert_encoding 错误 : Call to undefined function mb_convert_encoding(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37441150/
我目前正在编写一个 PHP 函数,但是在执行完整的脚本时出现错误: 错误: Call to undefined function mb_convert_encoding() 我的功能: functio
我正在尝试生成一个查询字符串。字符显示为不同的查询。 PHP版本:7.3.2 功能 $D->query = ''; if ($this->query('x')) { $D->query = m
我对 PHP 函数 mb_detect_encoding 有一些疑问。我无法将其转换为 ISO-8859-1。有帮助吗? 代码: $str = "åäö"; $encoding = mb_detect
我的网站设置了charset=UTF-8,mysql DATABASE也设置为UTF-8编码。 我的问题是,当我从 mysql 检索文本到网站时,我需要使用 php 函数 mb_convert_enc
出于某种原因,在 phpunit 中运行 mb_convert_encoding 时,我得到了意想不到的结果。例如执行以下操作: var_dump( mb_convert_encoding( utf8
引用this (excellent) answer .他指出,在 PHP 中转义输入的最佳解决方案是调用 mb_convert_encoding其次是 html_entities . 但为什么要使用相
如何使用 mb_convert_encoding 或任何其他方法在 PHP 中将俄语字符转换为 utf-8? 最佳答案 您是否尝试过以下操作?不过不确定它是否有效。 mb_convert_encodi
我有一个服务器 (Ubuntu 11.10 x64) 运行 PHP 5.3.8 和 Apache2/MySQL。我目前正在做一个项目,我需要做一些特定的字符编码,但我发现没有一个多字节(mb_* 函数
在 mb_convert_encoding() 中转换 windows-1256 时出错: Warning: mb_convert_encoding(): Unknown encoding "WIND
我有以下代码: mb_convert_encoding($string, 'HTML-ENTITIES', 'utf-8'); 我需要一个替代代码,它的功能完全相同,但不使用任何 mb_* 函数(mb
输入字符串: $value = "ACM=1,1+eval(1+name+(+ACM-1),ACM)"; 使用 mb_convert_encoding 的方法 mb_convert_encoding(
在 C# 上有没有一种方法可以将 unicode 字符串转换为 ASCII + html 实体,然后再转换回来?看,在 PHP 中,我可以这样做: Jöhan Strauß'; echo "UNICO
PHP中的iconv()和mb_convert_encoding()有什么区别?一个性能更好,更快等(例如使用特定编码)吗?在什么情况下,一种会比另一种更受欢迎? 以下是我认为我已经知道的: icon
PHP中的iconv()和mb_convert_encoding()有什么区别?一个性能更好,更快等(例如使用特定编码)吗?在什么情况下,一种会比另一种更受欢迎? 以下是我认为我已经知道的: icon
//reencoding string from UTF-8 to Latin1 echo mb_detect_encoding($out); $out = mb_co
我在这里使用的数据不在使用 utf8 编码的页面 我已将数据库和字段设置为使用 utf8_general_ci 现在,无论出于何种原因,我必须在变量上使用以下代码,以便让它在数据库中正确显示重音字符:
Fatal error: Call to undefined function mb_convert_encoding() in /home/abcdef/public_html/folder_nam
我是一名优秀的程序员,十分优秀!