Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/237.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 上载带有特殊字符的字符串时出错_Php_Special Characters - Fatal编程技术网

Php 上载带有特殊字符的字符串时出错

Php 上载带有特殊字符的字符串时出错,php,special-characters,Php,Special Characters,我正在上传一个有特殊字符的字符串 范例 $what = Fay King suggests ‘Miss Airheart’ as name for ‘Lady Lindy'" 它上传为 Fay King suggests ⬠ÜMiss Airheart⬠"! as name for ⬠我应该怎么做来避免这个解码错误 我尝试在字符串上使用utf8_编码,但没有成功。您尝试过简单的urlencode()吗 请确保上载字符串的页面和显示字符串的页面具有相同的文本编码,例如

我正在上传一个有特殊字符的字符串

范例

$what = Fay King suggests ‘Miss Airheart’ as name for ‘Lady Lindy'"
它上传为

Fay King suggests ⬠ÜMiss Airheart⬠"! as name for ⬠
我应该怎么做来避免这个解码错误


我尝试在字符串上使用utf8_编码,但没有成功。

您尝试过简单的urlencode()吗


请确保上载字符串的页面和显示字符串的页面具有相同的文本编码,例如:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>


通常,您的Web应用程序的每个页面都应该只有一个文本编码集。

您正在上载字符串吗?也;您会遇到什么类型的错误?粘贴到这里。@WayneWhitty修改了问题您是通过表单“上传”的吗?。通过GET或POST?。如何捕获字符串?@teofilioisraelvizcainorodrig:我正在使用php访问一个包含$what字符串的excel工作表,并最终将该字符串上传到其他网站的表单中。然后检查其他网站中的编码