php join函数应用

时间:2022-09-17 08:18:39
代码如下:

$key = array(); 
$val = array(); 
foreach ($_POST as $k=>$v) 

$key[] = '`'.strip_tags(mysql_real_escape_string(trim($k))).'`'; 
$val[] = "'".strip_tags(mysql_real_escape_string(trim($v)))."'"; 


$keys = join(",",$key); 
$vals = join(",",$val);