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.
if(in_array("sales_agent",$roleNames)) { echo "Hello world!" }