3v4l.org

run code in 300+ PHP versions simultaneously
<?php $states = '1,2,3'; $statesArray = implode(',',$states); if(in_array('2',$statesArray)) { echo 'bestseller'; } if(in_array('1',$statesArray)) { echo 'newproduct'; }

preferences:
46.65 ms | 402 KiB | 5 Q