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

Xml parsing
I need a suggestion about parsing xml with multiply parts like pervious...
i.e. different device

Multipe Dynamic Controls & AutoPostback Issue
I currently have a need to create many dynamic controls (Example Textboxes) that need to do a PostBa

Gerenate tabel in Php
I whant to generate a tabel takeing data from database like this one so the results to be display on

Include with Parameters
In a particular page I would like to include a file that requires $_GET parameters.

when I go

Transferring session variables into MySQL
I am trying to transfer $_SESSION variables into MySQL. However there is an error in my MySQL statem

db entry based on primary key
My "topics" table contains 10 entires
*--------------*
topicid topic
------

textfield unchanged
hi,
i want my form to know whether its textbox is unchange or not.

if($textbox == 'unchang

Form submissing with PHP and JQuery/Ajax
I have searched everywhere, but cannot find a solution for this... I have worked all day trying to g

Executing an exe
Hi. I have some bizarre problem with exec (other any other method) to launch exe's. I am making a ga

Delete all from a table
I can not get the following code to work. If I run the sql statement in the db it will delete all t

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