You could use the PHP in_array function
if( in_array( "bla" ,$yourarray ) )
{
echo "has bla";
}
Related Contents:
- How to add elements to an empty array in PHP?
- How to check whether an array is empty using PHP?
- How to pass an array within a query string?
- Filter array by its keys using an array of allowed keys
- How to get last key in an array?
- How can I sort arrays and data in PHP?
- Convert a comma-delimited string into array of integers?
- PHP: merge two arrays while keeping keys instead of reindexing?
- in_array() and multidimensional array
- php stdClass to array
- Get the first N elements of an array?
- Convert php array to Javascript
- PHP – Get key name of array value
- Best way to clear a PHP array’s values
- How to convert array values to lowercase in PHP?
- Checking to see if one array’s elements are in another array in PHP
- PHP case-insensitive in_array function
- Performance of FOR vs FOREACH in PHP
- How to detect duplicate values in PHP array?
- PHP: Can I get the index in an array_map function?
- How to get a form input array into a PHP array
- Shorthand for arrays: is there a literal syntax like {} or []?
- Recursive function to generate multidimensional array from database result
- Twig for loop for arrays with keys
- PHP – Merging two arrays into one array (also Remove Duplicates)
- How can I access an array/object?
- Transposing multidimensional arrays in PHP
- How to access elements in an array returned from a function?
- PHP get the last 3 elements of an associative array while preserving the keys?
- Case-insensitive array search
- How to clone an array of objects in PHP?
- Difference between “as $key => $value” and “as $value” in PHP foreach
- Opposite of array_intersect?
- PHP if in_array() how to get the key as well?
- How to implement class methods in array_map’s callable [duplicate]
- PHP error. Why is “variable undefined” inside array_map? [duplicate]
- Remove blacklist keys from array in PHP
- Remove all array elements except what I want?
- How to remove a variable from a PHP session array
- Laravel migration array type (store array in database column)
- Limit array to 5 items
- PHP: Remove the first and last item of the array
- Check and return duplicates array php
- Using a string path to set nested array data [duplicate]
- String contains any items in an array (case insensitive)
- PHP array_merge with numerical keys
- Check if two arrays have the same values (regardless of value order) [duplicate]
- MySQL PHP – SELECT WHERE id = array()? [duplicate]
- Get min and max value in PHP Array
- How to use php array with sql IN operator? [duplicate]