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

Namespace Problem
I'm having problem with a section of code with a variable namespace.

This code works fine:

How to change www in url with a specified name
Hi
I'm trying to change the url http://www.sitename.com/apparels to something like below
http:

Multiple Dropdown Selections
I have a form that let's a user insert a page with the ability to select categories. I want them to

"From field" in PHP email form
I used a wizard to create a PHP email form. I was able to customize it with the exception of the Fr

All possible combinations of String in PL/SQL
Hi All,

Could you please explain the logic of getting all possible combinations of String

PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page wi

Uploading files/images via forms
Hey all, I am building a database for work that will contain some minor data on plant species along

records between 2 dates
Hello all,

I have a date tracked table which contains effective_start_date and effective

Advice on how to delete a mysql row using my form
Hi,

I am very new to php and am struggling to work out how to delete a portfolio item (a row

Help with form post data and arrays
Hi all,

I am new to this forum... It has been awhile since i have worked with arrays, and i a

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