user888: I have a LED attached to my Arduino wifi shield that I want to control from my PHP web server.  In terms of communication, should I 

Make my Arduino a web server and then communicate with PHP web server via HTTP
Make my Arduino a web client and receive commands from my PHP web service.  I would parse the JSON response

Also my other question is should I communicate with JSON between my PHP web server or is there a better way to send commands to my LED light? 

user368: There's no need for either PHP or JSON. Simply detect when one of two URLs (say, /led/on and /led/off) has been accessed on the Arduino's web server, change the LED state, and return a 204 response.

user113: The REST protocol is ideal for this and there's a nice Sketch already written, called RESTduino on Github:
https://github.com/jjg/RESTduino
Basically (and loosely) REST treats a URL as a command.  Quoting from the RESTduino doc's:
"To turn on the LED attached to pin #9 (currently case sensitive!):
http://192.168.1.177/9/HIGH

This will set the pin to the HIGH state and the LED should light. Next try this:
 http://192.168.1.177/100

This will use PWM to illuminate the LED at around 50% brightness (valid PWM values are 0-255)."

888: <p>I have a LED attached to my Arduino wifi shield that I want to control from my PHP web server.  In terms of communication, should I </p>

<ol>
<li><p>Make my Arduino a web server and then communicate with PHP web server via HTTP</p></li>
<li><p>Make my Arduino a web client and receive commands from my PHP web service.  I would parse the JSON response</p></li>
</ol>

<p>Also my other question is should I communicate with JSON between my PHP web server or is there a better way to send commands to my LED light? </p>
 368: <p>There's no need for either PHP or JSON. Simply detect when one of two URLs (say, <code>/led/on</code> and <code>/led/off</code>) has been accessed on the Arduino's web server, change the LED state, and return a <a href="http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#2xx_Success" rel="nofollow">204 response</a>.</p>
 113: <p>The REST protocol is ideal for this and there's a nice Sketch already written, called RESTduino on Github:
<a href="https://github.com/jjg/RESTduino" rel="nofollow">https://github.com/jjg/RESTduino</a></p>

<p>Basically (and loosely) REST treats a URL as a command.  Quoting from the RESTduino doc's:</p>

<p>"To turn on the LED attached to pin #9 (currently case sensitive!):</p>

<pre><code>http://192.168.1.177/9/HIGH
</code></pre>

<p>This will set the pin to the HIGH state and the LED should light. Next try this:</p>

<pre><code> http://192.168.1.177/100
</code></pre>

<p>This will use PWM to illuminate the LED at around 50% brightness (valid PWM values are 0-255)."</p>
