select2 multiple get values code example
Example 1: get value select 2
//get selected value
$('#mySelect2').find(':selected').val();
Example 2: jquery select2 multiple select all
$("#checkbox").click(function(){
if($("#checkbox").is(':checked') ){
$("select > option").prop("selected","selected");
}else{
$("select > option").removeAttr("selected");
}
});
Example 3: select2 multiple selected values
in_array($value, $array)