在php中创建基本的Web服务 [英] Creating a basic web services in php
问题描述
我想找到如何使用PHP创建简单的Web服务.我是Web服务的新手. 有没有教程,所以我可以从头开始学习. 谢谢大家.
I want to find how to create a simple web service using PHP. I am new to web service. Is there any tutorial so I can learn it from the start. Thanks all.
我想托管此Web服务,以便可以在我拥有托管空间的android应用程序开发中使用此Web服务.
I want to host this webservice so I can use this web service in android app development I own my hosting space.
推荐答案
与任何其他类型的网站相比,Web服务没有什么特别之处.主要区别在于,输出通常采用HTML以外的其他格式,如今,它们通常为 JSON,在JSON中有自己的部分PHP手册
There is nothing particularly special about a web service when compared to any other kind of site. The major difference is that output is generally in a format other than HTML, these days it is usually JSON, which has its own section in the PHP manual
除此之外,这仅仅是拥有明智的URI的问题,它可能会采用明智的查询字符串或发布数据,并且可能需要某种身份验证(就像其他任何站点一样).
Aside from that it is just a matter of having sensible URIs, which may take sensible query strings or post data, and may require some kind of authentication (just like any other site).
这篇关于在php中创建基本的Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!