一、以下是CI框架
1、把所有的要接收的字段放在數組中
例:
我要接收:id,name,age,mobile 等循環
判斷即可<span>$req</span> = <span>array</span>('id','name','age','mobile');
<span>1</span><span>for</span>(<span>$i</span> = 0;<span>$i</span> < <span>count</span>(<span>$req</span>);<span>$i</span> ++<span> ){ </span><span>2</span><span>$j</span> = <span>$this</span>->load->get_post(<span>$req</span>[<span>$i</span>],<span>true</span><span>); </span><span>3</span><span>if</span>(<span>empty</span>(<span>$j</span><span>)) </span><span>4</span><span>exit</span>(<span>$req</span>[<span>$i</span>].' 为空'<span>); </span><span>5</span><span>$data</span>[<span>$i</span>] = <span>$j</span><span>; </span><span>6</span><span>} </span><span>7</span><span>print_r</span>(<span>$data</span>);
以上就介紹了CI框架,原始碼一次判斷取得postget資料是否有某個欄位值為空方法,包括了post,原始碼方面的內容,希望對PHP教學有興趣的朋友有所幫助。