P1) Array Function 1-1) Write a function calculateUnion() that gets two arrays and finds the union of the elements of th
Posted: Fri May 20, 2022 6:17 pm
P1) Array Function
1-1) Write a
function calculateUnion()
that gets two arrays and finds the union of the elements of
the two arrays. The function should return unique members (no
duplicate members in the final result array).
1-2) Write a
function calculateIntersection()
that gets two arrays and finds the intersection of the
elements of the two arrays. The function should return unique
members (no duplicate members in the final result array).
1-3) Write a
function calculateSetDiff() that gets
two array arr1 and arr2 respectively and finds the arr1 - arr2 (all
the elements that are a member of arr1 but not in arr2). The
function should return unique members (no duplicate members in
the final result array).
please use PHP code for the problem, post the details
and result on the below. Thank you.
1-1) Write a
function calculateUnion()
that gets two arrays and finds the union of the elements of
the two arrays. The function should return unique members (no
duplicate members in the final result array).
1-2) Write a
function calculateIntersection()
that gets two arrays and finds the intersection of the
elements of the two arrays. The function should return unique
members (no duplicate members in the final result array).
1-3) Write a
function calculateSetDiff() that gets
two array arr1 and arr2 respectively and finds the arr1 - arr2 (all
the elements that are a member of arr1 but not in arr2). The
function should return unique members (no duplicate members in
the final result array).
please use PHP code for the problem, post the details
and result on the below. Thank you.