REST WebService PHP (basic)

Website:
1. Response will be in HTML
2. Accessed by Humans via web browsers

WebService:
1. Accessed by Programs
2. Response will be in XML or JSON.
3. User to Communicate between heterogeneous Systems and Platforms

example :
getting response = http://localhost/index.php?id=x

change URL to get response jSON
create .htaccess

http://localhost/index.php?id=x
modified
http://localhost/x