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

自动过虑POST数据

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 19:32:061059browse

无详细内容 无 //获取当前表中的所有字段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;
	}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn