Heim >php教程 >php手册 >自动过虑POST数据

自动过虑POST数据

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 19:32:061092Durchsuche

无详细内容 无 //获取当前表中的所有字段public function _facade($post){$data = array();$arr=array();$sql = 'select * from '.$this-table;$res = $this-db-ftable($sql);for($i=0;$imysql_num_fields($res);$i++){$m = mysql_fetch_field($res);$m = $m-

	//获取当前表中的所有字段
	public function _facade($post){
		$data = array();
		$arr=array();
		$sql = 'select * from '.$this->table;
		$res = $this->db->ftable($sql);
		for($i=0;$i<mysql_num_fields($res);$i++){
			$m = mysql_fetch_field($res);
			$m = $m->name;
			if(!in_array($m,$arr)){
				array_push($arr,$m);
			}
		}
		foreach($post as $k=>$v){
			if(in_array($k,$arr)){//判断$K是否为数组的字段,如果不是追加
				$data[$k]=$v;
			}
		}
		return $data;
	}
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn