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

how to get IP address?
hey guys,

i have this code which is supposed to get me the IP address of my site visitors:

How would I protect......
I have a from, actually, a good amount of forms. How can I make it so you can't type the characters:

need help in creating captcha
hi i have a problem creating captcha system. i create some basic script for image displaying but it

Image DPI
Hi.

I allow users to upload images, the user then is able to adjust several settings for the

Limiting uploaded file type
Hi. First post here
I am working on a simple upload script, and I need it to limit the allowed f

Upload file!
Ok i have a form..
Code: <form name="form1" method="post" action=&quo

Text to picture Generator
Hello, i have found this script and it works really good^^ But i have one problem, i would like to c

Question about the upload of large files
Hi there,

I have a question about the upload of large files, like videos (files generally abo

help with Get_
ok some how this is not working i am not sure what i am doing wrong here but what this does is when

RadioButtonList data selection
view plaincopy to clipboardprint?

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