You may want to look at this article and the follow-up:
http://www.gen-x-design.com/archives/create-a-rest-api-with-php/
Your question is very open-ended, so this tutorial may be the best starting point.
The link above is no longer working so check out this tutorial:
http://net.tutsplus.com/tutorials/other/a-beginners-introduction-to-http-and-rest/