This question already has an answer here:
- How to find a string in an array in PHP? 6 answers
If I have an array that contains some strings like so
$roleNames = ['sales_agent', 'admin'];
And I want to check if that array contains the string 'sales_agent', what would be the best way to go about this with PHP?
Ideally I would like to have the check return a boolean value.
</div>