php join函数应用
发布时间:2016-12-29 来源:查字典编辑
摘要:复制代码代码如下:$key=array();$val=array();foreach($_POSTas$k=>$v){$key[]='`'....
复制代码 代码如下:
$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);