473,387 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

array_diff_assoc Madness... Help?

Hi there

I'm trying to compare two arrays at a time to figure out if data has
changed, and array_diff_assoc is telling me that there *are differences*
between:

Array
(
[Floor Common Area] =2878.17
[3500] =12343.97
[3550] =3076.52
[3570] =1631.07
[3580] =927.34
[3599] =2791.54
[Storage for 3500] =80.25
)
and:
Array
(
[3500] =12343.97
[3550] =3076.52
[3570] =1631.07
[3580] =927.34
[3599] =2791.54
[Floor Common Area] =2878.17
[Storage For 3500] =80.25
)

as well as:

Array
(
[Gross Building Area] =25306.95
[Vertical Penetrations] =1498.76
[Floor Common Area] =3104.52
[3600] =13108.74
[3663] =7429.54
[Storage for 3600] =83.27
)
and:
Array
(
[3600] =13108.74
[3663] =7429.54
[Floor Common Area] =3104.52
[Gross Building Area] =25306.95
[Storage For 3600] =83.27
[Vertical Penetrations] =1498.76
)

.... obviously incorrectly. Now, it correctly reports *no differences*
between:

Array
(
[Gross Building Area] =17128.33
[Vertical Penetrations] =1253.81
[Building Common Area] =15061.70
[Radio Equipment Room] =152.21
[Spanish Broadcasting] =231.78
)
and:
Array
(
[Building Common Area] =15061.70
[Gross Building Area] =17128.33
[Radio Equipment Room] =152.21
[Spanish Broadcasting] =231.78
[Vertical Penetrations] =1253.81
)
I am going crazy trying to figure out why PHP tells me that the top two
array comparisons are different. This data is part of a larger set, and
my 'troublesome' comparisons seem to have one thing in common: a key
called 'Storage for xxxx', where xxxx is a number. So, i'm guessing
that one xxxx is being interpreted as a string, while the other is being
interpreted as numeric? It's possible, I guess, as all the arrays are
being created dynamically... and one is coming from a database.

Can anyone offer some insight? Do I need to write my own
array_diff_assoc function?

Btw, ksort()-ing makes no difference.

Thanks in advance....

Jul 25 '07 #1
2 1377
Rik
On Wed, 25 Jul 2007 16:37:31 +0200, Good Man <he***@letsgo.comwrote:
[Storage for 3500] =80.25
[Storage For 3500] =80.25
Not the same, are they? (f vs, F)
--
Rik Wasmus
Jul 25 '07 #2
Rik <lu************@hotmail.comwrote in news:op.tv0ziyhxqnv3q9@metallium:
On Wed, 25 Jul 2007 16:37:31 +0200, Good Man <he***@letsgo.comwrote:
> [Storage for 3500] =80.25
[Storage For 3500] =80.25

Not the same, are they? (f vs, F)
Rik, you made my day. Thanks a bunch. Sometimes a pair of fresh eyes can
solve the most simple or complex of problems!!!!

Jul 25 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Lane LiaBraaten | last post by:
I am developing a GUI that uses multiple threading.Threads, and Queue.Queues for communicating between the threads, and threading.Timers for checking the queues. Everything works well (runs to...
4
by: Afanasiy | last post by:
Can I easily convert from ISO to Gregorian calendars in Python 2.3? For example, what Gregorian date is year 2004, week 1, day 1? If possible, I'd greatly prefer to do this with the standard...
12
by: Russell Stevens | last post by:
Should be trivial - I want to detect the program version so that I can take steps to update things to the current version. Pretty simple - just use Application.ProductVersion So I install the...
0
by: Joe G \(Home\) | last post by:
Hi All, I have 16 bytes 0x02, then "0F0270632E30" then <CR> then <LF> then 0x03 that are received by the serial port of my PCs. The only variation is the string ASCII hex values I know...
1
by: Kayvine | last post by:
Hi guys, this is a question I have for an assignment, it is pretty long, but I am not asking for the code(well if someone wants to write I'll be really happy, lol), but I just want to know how to...
1
by: =?Utf-8?B?SmFja2Rhdw==?= | last post by:
Hi! I just up-graded my "Dell Help & Support Center" and now every time I start upthe Dell folder is open on the desk top. How do I make it GO AWAY, lest madness overtake me. Thanks! -- DAW
60
by: DuncanIdaho | last post by:
Hello This is a rant. If you don't want to read it then don't, simple really. I usually spend my working life buried away in the back ends (fnar) of business systems. Serverside stuff over...
20
by: raylopez99 | last post by:
Took a look at all the fuss about "lambda expressions" from Jon Skeet's excellent book "C# in Depth". Jon has an example, reproduced below (excerpt) on lambda expressions. My n00b take: it's...
0
by: Pavel Minaev | last post by:
On Aug 14, 1:37 pm, raylopez99 <raylope...@yahoo.comwrote: You are, of course, entitled to your opinion, but lambdas are a part of C# 3.0, and any C# developer has to know their ins and outs if...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.