array_diff weirdness


Posted on 16th Feb 2014 07:03 pm by admin

I'm using the following bit of code

$diff = array_diff($pids, $pidlist);
$diff = array_values($diff); //reindex array to remove empties
//output to $discrepancy
print_r($diff);
exit;

Both $pids and $pidlist contain exactly the same value; so I would have expected that value not to appear in $diff - but it is. Both $pids and $pidlist contain a few thousand values, and I've only found this one example which appears in both lists as well as $diff.

Can anybody shed any light?

No comments posted yet

Your Answer:

Login to answer
216 Like 23 Dislike
Previous forums Next forums
Other forums

Troubles with a spider class
I am building a spider that will crawl through random whitepages (eg. anywho.com, switchboard.com, w

adding 0 to numbers
Hey guys i need to create a 00001 number in a loop. Is there a better way of forcing a 5 digit numbe

How to load mysql (and other) extensions into PHP
How to load mysql (and other) extensions into PHP PHP Development forum discussing coding practices,

[RESOLVED] Socket/Port remains open after app crashes
I'm having this problem with a networked app in vb.net.

If the program exits normally the por

calculator
I can't figure out why this code doesn't work. No error messages. Page loads.

Code: <

MS Access data into a html table
Hi everyone, I am quite a novice at php but I have created some helpful scripts that fetch data
f

Script not running properly
Hello Everyone
This is a basic script for posting to a database. I'm not sure why it doesn't work

PHP / MySQL Associative Multidimensional Array:
Hello.

I have data in a MySQL Table that adheres to the below: (note, no index, could add if

php/xmlrpc class issue
I am working on xml-rpc in php to start with.

I have a class that only has variables defined

Update Database
Hi All,


I have a problem with this:

Code: [Select]<?php
session_start();

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash