Array Plus and minus problems
Known quantity groups A and B.
Array A:
Array (
Array (
' Cust_no ' = ' 310f6 1va5a ',
' Lotno ' = ' 2X15 ',
' Part_count ' = ' 32 ',
),
Array (
' Cust_no ' = ' 310f6 1va5a ',
' Lotno ' = ' 2z25 ',
' Part_count ' = ' 32 ',
),
)
Array B:
Array (
Array (
' Cust_no ' = ' 310f6 1va5a ',
' Total ' = ' 48 ',
),
)
When the array a cust_no is 310f6 1va5a, the corresponding total is 32+32=64, and the total amount of the array B cust_no to 310f6 1va5a is 48.
What do you want to do with array A when the sum of array B is 48 o'clock? What is the remaining result of array a?
In this case,
Get the result of array A:
Array A:
Array (
Array (
' Cust_no ' = ' 310f6 1va5a ',
' Lotno ' = ' 2X15 ',
' Part_count ' = ' 32 ',
),
Array (
' Cust_no ' = ' 310f6 1va5a ',
' Lotno ' = ' 2z25 ',
' Part_count ' = ' 16 ',
),
)
Result of remaining array a:
Array A:
Array (
Array (
' Cust_no ' = ' 310f6 1va5a ',
' Lotno ' = ' 2X15 ',
' Part_count ' = ' 0 ',
),
Array (
' Cust_no ' = ' 310f6 1va5a ',
' Lotno ' = ' 2z25 ',
' Part_count ' = ' 16 ',
),
)
How can you get such a result?
Share to:
------Solution--------------------