关于array_diff函数的有关问题

WBOY
Release: 2016-06-13 12:12:46
Original
1004 people have browsed it

关于array_diff函数的问题
我用array_diff对比读取到的txt文件标题是否和我设定的一样,其中最后一个字段始终判定为不一样,表面看最后一个字段多了一个空格,我加了一个空格,也判定不一样,请问我用什么方法看txt文件最后一个字段的内容是什么??
------解决思路----------------------
base64 编码的:
DQ== 是回车符 0x0d (chr(13))
IA== 是空格符 0x20 (chr(32))

一般情况下首尾的空白字符是可忽略的,所以宜 trim 一下
$ar = array_diff(array_map('trim', $array), array_map('trim', $value));

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template