Heim >Backend-Entwicklung >PHP-Tutorial >php 简单的web get 请求处理

php 简单的web get 请求处理

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-29 09:04:181056Durchsuche
<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教程有兴趣的朋友有所帮助。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn