Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/280.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
将另一个Unicode符号作为输出,这甚至不在我的php代码中_Php_Unicode_Symbols - Fatal编程技术网

将另一个Unicode符号作为输出,这甚至不在我的php代码中

将另一个Unicode符号作为输出,这甚至不在我的php代码中,php,unicode,symbols,Php,Unicode,Symbols,我的代码没有给出所需的输出,因为它给出了这些输出 我的代码中甚至没有的符号 for example 2e780048b99d71f45a //this the input string I Ä g Â Æ Ã Ã È Â //this is the output string what i am getting I Ļ g ¢ Ơ ý Ñ ȟ ¶ // desired output 我正在编码- 2e如我所愿 78 asĻ 00作为g 48作为( 等等 ` <

我的代码没有给出所需的输出,因为它给出了这些输出 我的代码中甚至没有的符号

 for example 
 2e780048b99d71f45a  //this the input string
 I Ä g Â Æ Ã Ã È Â   //this is the output string what i am getting 
 I Ļ g ¢ Ơ ý Ñ ȟ ¶   // desired output
我正在编码-

2e如我所愿

78 asĻ

00作为g

48作为(

等等

   ` <?php
     $str=file_get_contents("t.txt");

     $tlength = strlen($str)-1;
  for($i2=0;$i2<=$tlength;$i2++)
{
    if($str[$i2]=='2'&&$str[$i2+1]=='e')
      {
         $str[$i2]='I';
        $str[$i2+1]=" ";
        $i2++;
      }
  if($str[$i2]=='7'&&$str[$i2+1]=='8')
     {
        $str[$i2]='Ļ';
        $str[$i2+1]=" ";
         $i2++;
      }
      }
    // and so on for other  input string
// and after all if() part execution, code will execute last part which is given below
 $str= str_replace(' ', "", $str);

  $myfile = fopen("test.txt", "w") or die("Unable to open file!");

  fwrite($myfile, $str);


  fclose($myfile);

   ?>`
``
我在windows8.1上使用升华ide和xammp


我认为一些特殊字符的长度超过8位(可能是16位或32位)。在输出时,它只需要从实际大于8位的特殊字符中提取8位,并且只打印8位值。有没有办法解决这个问题?

我猜这是字符编码的问题。我认为问题是系统只提取8位字符。