Out of all the posts that I came across with, this one worked.

To use it, do it like this:

This code came from upshots.org.

This is the best 1 liner answer I found in the Internet to check if an array’s item or value or however you may call it exists in another array.

Using the function array_intersect(), you can achieve this. User lorenzo-s from Stack Overflow gave this 1 liner code that did the trick.

Do note that array_intersect() is case sensitive.

Here is a useful function to remove any element by id using Javascript.

Related Posts Plugin for WordPress, Blogger...