php join函数应用

2015-01-24信息快讯网

php join函数应用,需要的朋友可以参考下。

 
$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); 
©2014-2024 dbsqp.com