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

PECL uploadprogress for php5.2
Hey, I just installed PHP5 via .htaccess on my 1and1 Shared Hosting Account.

How would I exac

Structure Question - One Table or One Table Per Record Set?
I have a web app (mySQL and PHP) which allows people to create an item with up to 200 records which

Sequencing or queuing parallel process
Scenario is as follows
There is one parent process say P1 and 4 child processes say A B C D

how to remove in php string display
My code is $message="We're looking at developing our website."; $body= "My mess

Extract specific information from a PHP Multidimensional Array
Howdy! I've racked my brain over this for 24 hours now. I think it's time I asked for help. I'm lear

Selecting an "empty" date formated field
How do you select an "empty" date field? I've tried the few ways I can think.
SQL> select

Schedule editor
Hi,

I have a question related to Schedule editor.
If we schedule a BLS for every 30

Generate multilayered array from string.
ok so i have a string that looks like this:
Code: [Select]blog:edit_all,delete_all|users:edit_all

php multiple action on submit
I have a form which says:

<form enctype='multipart/form-data' method='post' action='pr

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

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