1.txt文本文件中的一行文本:
2000|抑制|Inhibition|||①接受刺激后,组织或机体活动减弱或变为相对静止.焦虑和精神恍惚会使身体机能减化,导致抑制.是与兴奋相反的生理现象.②也作抑止.压制;控制.|||to restrain; to control; to check; to contain; to govern; to suppress; to bottle sth. up; to bring (or get) sth. under control; to fight sth. back (or down); to hold sth. back|张三|2008-10-15 09:46:12
$handle=fopen("1.txt","r");
$data=fgetcsv($handle,1024,"|");
$num=count($data);
print_r($data);结果:Array ( [0] => 2000 [1] => 抑制 [2] => Inhibition [3] => [4] => [5] => ①接受刺激后,组织或机体活动减弱或变为相对静止.焦虑和精神恍惚会使身体机能减化,导致抑制.是与兴奋相反的生理现象.②也作抑止.压制;控制. [6] => [7] => [8] => to restrain; to control; to check; to contain; to govern; to suppress; to bottle sth. up; to bring (or get) sth. under control; to fight sth. back (or down); to hold sth. back [9] => 张三|2008-10-15 09:46:12 [10] => ) 为什么是这样的,为什么时间不在第十个单元里。
Array ( [0] => 2000 [1] => 抑制 [2] => Inhibition [3] => [4] => [5] => ①接受刺激后,组织或机体活动减弱或变为相对静止.焦虑和精神恍惚会使身体机能减化,导致抑制.是与兴奋相反的生理现象.②也作抑止.压制;控制. [6] => [7] => [8] => to restrain; to control; to check; to contain; to govern; to suppress; to bottle sth. up; to bring (or get) sth. under control; to fight sth. back (or down); to hold sth. back [9] => 张三 [10] =>2008-10-15 09:46:12 )
2000|抑制|Inhibition|||①接受刺激后,组织或机体活动减弱或变为相对静止.焦虑和精神恍惚会使身体机能减化,导致抑制.是与兴奋相反的生理现象.②也作抑止.压制;控制.|||to restrain; to control; to check; to contain; to govern; to suppress; to bottle sth. up; to bring (or get) sth. under control; to fight sth. back (or down); to hold sth. back|张三|2008-10-15 09:46:12
$handle=fopen("1.txt","r");
$data=fgetcsv($handle,1024,"|");
$num=count($data);
print_r($data);结果:Array ( [0] => 2000 [1] => 抑制 [2] => Inhibition [3] => [4] => [5] => ①接受刺激后,组织或机体活动减弱或变为相对静止.焦虑和精神恍惚会使身体机能减化,导致抑制.是与兴奋相反的生理现象.②也作抑止.压制;控制. [6] => [7] => [8] => to restrain; to control; to check; to contain; to govern; to suppress; to bottle sth. up; to bring (or get) sth. under control; to fight sth. back (or down); to hold sth. back [9] => 张三|2008-10-15 09:46:12 [10] => ) 为什么是这样的,为什么时间不在第十个单元里。
Array ( [0] => 2000 [1] => 抑制 [2] => Inhibition [3] => [4] => [5] => ①接受刺激后,组织或机体活动减弱或变为相对静止.焦虑和精神恍惚会使身体机能减化,导致抑制.是与兴奋相反的生理现象.②也作抑止.压制;控制. [6] => [7] => [8] => to restrain; to control; to check; to contain; to govern; to suppress; to bottle sth. up; to bring (or get) sth. under control; to fight sth. back (or down); to hold sth. back [9] => 张三 [10] =>2008-10-15 09:46:12 )
$data=fgetcsv($handle,1024,"|");
$num=count($data);
print_r($data);
又是正常的! 我也搞不懂了,觉得跟编码有关的 有些东西会弄糊涂!!