Comparing arrays confusion
| From: | Alex Hogan | Date: | Mon, 26 Apr 2004 15:20:37 +0000 |
| Subject: | Comparing arrays confusion | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-184664@lists.php.net to get a copy of this message | ||
I am having trouble properly comparing a couple of arrays. (Actually three
arrays)
Class array
Array ( [] => Active / Semiconductor [1] => Cable & Wire [2] => Enclosure
[3] => Relay & Solenoid [4] => Industrial Control [5] => Audio, Warning,
Video, & Security [6] => Connectors [7] => Cable Assembly [8] => Power
Supplies [9] => Buyout / Specials )
Subclass array
Array ( [] => Passive Component [1] => Optoelectronic [2] => Connectors [3]
=> Boards/Printed Circuit Board (PCB) [4] => Thermal Management )
Percentages arrayArray ( [] => 0.13 [1] => 2.22 [2] => 32.35 [3] => 15.58
[4] => 0.17 [5] => 18.32 [6] => 1.29 [7] => 0.11 [8] => 16.89 [9] => 11.88 )
The class array and the subclass array are the first comparison that I'm
doing to produce;
Intersect arrayArray ( [6] => Connectors )
Now I have the difference;
Intersect difference arrayArray ( [] => Passive Component [1] =>
Optoelectronic [3] => Boards/Printed Circuit Board (PCB) [4] => Thermal
Management )
What I want to do from here is to associate the intersection of the two
arrays with the percentage array;
Intersect combined arrayArray ( [Connectors] => 1.29 )
Then have the remaining array members from the subclass array display with a
0 value. I have created an associative array with the class and subclass
arrays.
How do I display the subclass array with the value from the percentages
array on the intersection of the subclass and class?
alex hogan
******************************************************************
The contents of this e-mail and any files transmitted with it are
confidential and intended solely for the use of the individual or
entity to whom it is addressed. The views stated herein do not
necessarily represent the view of the company. If you are not the
intended recipient of this e-mail you may not copy, forward,
disclose, or otherwise use it or any part of it in any form
whatsoever. If you have received this e-mail in error please
e-mail the sender.
******************************************************************