The previous answers are all doing more work than they need to. Just use array_diff. This is the simplest way to do it:
$containsAllValues = !array_diff($search_this, $all);
That’s all you have to do.
More Related Contents:
- Perform logic operations on boolean array values
- Can I bind an array to an IN() condition in a PDO query?
- PHP Constants Containing Arrays?
- Sorting a php array of arrays by custom order
- How to Remove Array Element and Then Re-Index Array?
- How do I sort a multidimensional array by one of the fields of the inner array in PHP? [duplicate]
- PHP: merge two arrays while keeping keys instead of reindexing?
- How to check if an array value exists?
- Notice: Array to string conversion in
- php – How do I fix this illegal offset type error
- Posting multidimensional array with PHP and CURL
- Recursively remove empty elements and subarrays from a multi-dimensional array
- PHP array_filter with arguments
- How to convert an array into an object using stdClass() [duplicate]
- Unexpected bracket ‘[‘ – PHP [duplicate]
- PHP case-insensitive in_array function
- scandir() to sort by date modified
- Print the keys of an array
- How to delete object from array inside foreach loop?
- Sort Object in PHP
- Best method for sum two arrays [closed]
- How do i count same values in an array and store it to a variable?
- Chunk and transpose a flat array into rows with a specific number of columns
- Notice: Undefined index when trying to increment an associative array in PHP
- PHP – Get key name of array value
- What is the max key size for an array in PHP?
- Sort array by value alphabetically php
- PHP Spread Syntax in Array Declaration
- Sort a multidimensional array descending by subarray count and preserve first level keys
- Why does PHP not complain when I treat a null value as an array like this?