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
Did you know?Explore Trending and Topic pages for more stories like this.
//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

using variables in another page
I have a test database set up on localhost. I have a form that I can type a name into, hit the butto

eregi to preg
Im converting my regex for php 5.3 and I am stuck on the following

Code: [Select]if((eregi(&q

Pagination
Hi All,

I think I'm finally getting somewhere with pagination!

I can now submit a quer

private constructor
Hello,

Can we create a constructor as private? If yes, what is the use of it? If no, why can'

Redistributing dependent dlls
Hai all ,

I have created an application in VC++ using VS2008 in a development machine which r

UTL File problem
Hi
I have a file in certain path with the following permissions (The file is a dummy file witho

help with php
It's not displaying or pulling anything out of the database.


Code: <html><

Pre-Fill out a PHP form...??
This is for work actually (geek squad). We have to fill out this online php form at work over and ov

Transaction variant for VA02 not working
My requirement is to have transaction for user to only add the output and print a sales order.

pull content
I have an existing page, domain/adverts.php which has a good PR. I've just rebuilt my site and the n

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