- implode: documentation ( source)
- in_array: documentation ( source)
<?php
$states = '1,2,3';
$statesArray = implode(',', $states);
if(in_array('2',$statesArray)) {
echo 'bestseller';
}
if(in_array('1',$statesArray)) {
echo 'newproduct';
}