Hi,
This might be simple but I am not sure how to go about it.
I have a multiselect field (mainCategories
), with values separated by ‘|’, and I need to run an if statement on it to see if it contains any of 3 specific values. What is the best way of doing it? Pseudo code below:
if($page->mainCategories()->contains(['something','another-thing','yet-another']):
echo 'This page has at least one of Something, Another thing and Yet another selected in the multiselect';
endif;
If anyone has any pointers that would be great.