if(isset($_POST['s'])){
$s = $_POST['s']; //получаю значение checkbox (string);
}
preg_match_all('/$s/u',$val,$arr,PREG_PATTERN_ORDER);
//не могу использовать $s
preg_match_all('/\$s/u',$val,$arr,PREG_PATTERN_ORDER);
preg_match_all('/'.$s.'/u',$val,$arr,PREG_PATTERN_ORDER);