Answer the question
In order to leave comments, you need to log in
How do one php array compare with another add the difference to the last one?
Hello! Please tell me how to implement in php. There is an array $a (contains multiple values) and an array $b (empty). Compare $a with $b and add the difference to $b, then iterate until the array $b is completely filled with all elements from $a. Tried array_diff(), but it compares by values, not by keys
Answer the question
In order to leave comments, you need to log in
php.net/manual/en/ref.array.php
We see the array_diff_assoc function, try
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question