How to delete values from an array using php

I have two arrays, $array_1 and $array_2.
If a value in $array_2 is also found in $array_1 it should be deleted from $array_1.
The same value might be found several times in both of the arrays. Is the value present in $array_2, regardless of number of appearances, it should be deleted from all appearances in $array_1.
Script language: php
What procedure do you recommend?
Lennart EricsonAmateurAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Peos JohnPHPCommented:
You can use array_diff function for this.

Value  green is twice in below example.



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Julian HansenCommented:
Only recommendation I would make over Peos John's reply is to rather use the resource as a reference. W3 Schools is ok but PHP.Net is the definitive source and has a wealth of other related information in the examples, topic posts and related function lists
Ray PaseurCommented:
No points for this, please, but I would add that sometimes the most useful part of the online PHP manual are the user-contributed notes in the function reference.  Examples:  <<< Especially this one!
Lennart EricsonAmateurAuthor Commented:
Sorry for late reply.
Thanks so much. It worked very well.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.