One, the following is the CI framework
1. Put all the fields you want to receive in the array
Cases:
I want to receive: fields such as Id,name,age,mobile
$req Array (' id ', ' name ', ' age ', ' mobile ');
2, for the loop to judge can
1 for ($i = 0; $i Count ($req); $i + + ) {2$j$this->load->get_post ($req[ $i],true); 3 if (empty($j)) 4 Exit ($req[$i]. ' Empty '); 5 $data [$i$j; 6 }7print_r($data);
Second, the source code judgment method (will not nonsense, directly on the code)
$req Array (' id ', ' name ', ' age ', ' mobile '); for ($i = 0; $i Count ($req); $i + + ) {$j$_post[$req[$i]] ; if (empty($j)) Exit ($req[$i]. ' Empty '); $data [$i$j;} Print_r ($data);
Conclusion:
In fact, the CI framework and source code can be used in the source code this method (ii), but in order to verify the security, the use of the first scenario, the above call the other method is PHP comes with, which method does not understand, you can check the PHP help document (Big God ignore)
The above describes the CI framework, the source code one-time judgment to get postget data whether there is a field value is empty method, including the post, source code aspects of the content, I hope the PHP tutorial interested in a friend helpful.