PHP to handle 0 zero value

foreach($fields as $key => $field){
	$value = $this->input->post($key);

	if($value == false){
		if($value === "0"){
			$data[$key] = $value;
		}elseif($field[1] == true){
			$this->failed_response(0, $field[0] . ' 不正確');
		}else{
			$data[$key] = null;
		}
	}else{
		$data[$key] = $value;
	}
}