Simpan beberapa nilai di kotak pilih setelah muat ulang di PHP

/**
This code was pasted by ProgrammerRimon on: 2022-02-23
******/

/***
* 
* @param: multiplce selection keeping function, array1, array2: match Array, total array,
* 
*/
	function gt($a) {return gettype($a);}

	  function kpm($ma=false, $ta=fasle) {
		if(($ma&&$ta) && (gt($ma)== 'array'&& gt($ta)== 'array')) {
		 foreach ($ma as $v) {
		   $s = '';
		  if(in_array($v, $ta)) $s = 'selected'; else $s = '';
		       echo "<option $s value='$v' >$v</option>";
	       }
         }
       }
Homely Hamerkop