<span><span>$output</span><span>= </span><span>array</span><span>(); </span><span>$a </span><span>= @</span><span>$_GET</span><span>[</span><span>'useid'</span><span>] ? </span><span>$_GET</span><span>[</span><span>'useid'</span><span>] : </span><span>''</span><span>; </span><span><em>//$uid = @$_GET['uid'] ? $_GET['uid'] : 0; </em></span><span><em></em></span><span>if </span><span>(</span><span>empty</span><span>(</span><span>$a</span><span>)) { </span><span><em>// $output = array('data'=>NULL, 'info'=>'ios!', 'code'=>-201); </em></span><span><em></em></span><span>$output</span><span>= </span><span>array</span><span>(</span><span>'hahah'</span><span>=></span><span>'hello'</span><span>, </span><span>'requestDic'</span><span>=></span><span>'hello'</span><span>,</span><span>'hello'</span><span>=></span><span>array</span><span>(</span><span>'image'</span><span>=></span><span>'www.baidu.com'</span><span>,</span><span>'imageurl'</span><span>=></span><span>'www.baidu.com'</span><span>)); </span><span>exit</span><span>(json_encode(</span><span>$output</span><span>)); </span><span> }</span><span>elseif</span><span>(!</span><span>empty</span><span>(</span><span>$a</span><span>)){ </span><span>$output</span><span>= </span><span>array</span><span>(</span><span>'hahah'</span><span>=></span><span>'hello'</span><span>, </span><span>'requestDic'</span><span>=></span><span>'hello'</span><span>,</span><span>'hello'</span><span>=></span><span>array</span><span>(</span><span>'image'</span><span>=></span><span>'www.sina.com'</span><span>,</span><span>'imageurl'</span><span>=></span><span>'www.sina.com'</span><span>)); </span><span>exit</span><span>(json_encode(</span><span>$output</span><span>)); </span><span> };</span></span>
以上就介紹了php 簡單的web get 請求處理,包括了方面的內容,希望對PHP教程有興趣的朋友有幫助。