我一直在用这个来绞尽脑汁。
我有两个数组:
数组 1 从 CSV 文件中提取。
大批 ( [0] => 数组 ( [uid] => cgajate [日期] => 20120918 ) [1] => 数组 ( [uid] => badrock5 [日期] => 20120920 ) [2] => 数组 ( [uid] => ricoetc [日期] => 20120921 ) [3] => 数组 ( [uid] => ricoetc1 [日期] => 20120923 ) [4] => 数组 ( [uid] => darbyfired [日期] => 20120922 ) [5] => 数组 ( [uid] => sagers.andrew [日期] => 20120922 ) [6] => 数组 ( [uid] => frankfurt9 [日期] => 20120923 ) [7] => 数组 ( [uid] => 沙滩男孩 [日期] => 20120923 ) [8] => 数组 ( [uid] => 惹火 [日期] => 20120923 ) [9] => 数组 ( [uid] => kingsxrules [日期] => 20120923 ) [10] => 数组 ( [uid] => 理查德.bitto [日期] => 20120924 ) [11] => 数组 ( [uid] => christopher.boss [日期] => 20120925 ) [12] => 数组 ( [uid] => eric.robinson2 [日期] => 20120926 ) )
数组 2 从 SQL 数据库中提取。
大批 ( [0] => 数组 ( [uid] => cgajate [日期] => 20120919 ) [1] => 数组 ( [uid] => ricoetc [日期] => 20120921 ) [2] => 数组 ( [uid] => ricoetc1 [日期] => 20120922 ) [3] => 数组 ( [uid] => frankfurt9 [日期] => 20120923 ) [4] => 数组 ( [uid] => 沙滩男孩 [日期] => 20120923 ) [5] => 数组 ( [uid] => 惹火 [日期] => 20120923 ) [6] => 数组 ( [uid] => kingsxrules [日期] => 20120923 ) [7] => 数组 ( [uid] => eric.robinson2 [日期] => 20120926 ) )
我基本上要做的是检查是否有任何 UID 匹配。如果有匹配项,它将检查哪个日期比另一个日期更新(所以本质上是哪个日期大于)。然后它将它们添加到一个数组中,其中 UID 与两个数组中的数据都不匹配。
对不起,如果很难理解。有点难以解释。
任何和所有的帮助表示赞赏,在此先感谢大家。