A
A
Alexander Nazarov2018-04-03 21:14:20
PHP
Alexander Nazarov, 2018-04-03 21:14:20

How to find the missing number?

There are two arrays:

$mass1 = array(1,2,3,4,5);
$mass2 = array(1,2,4,5);

How to compare both arrays and return the missing number in the second array "3" ?
I have no idea how to do it. Tell me if it's not difficult or indicate where to dig?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Paul Denisevich, 2018-04-03
@deniamnet

array_diff($mass1, $mass2)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question