how check and return value from a php file on server by arduino.


I want Turn On or Of a LED on my Arduino board by web request or get or post a request through the internet, I can send data to a server or API,

now how I can turn ON/OFF LED by thingspeak or my own server by PHP code?

for example, I designed a PHP page on my that have form field by post or GET method, I want when type "1" in this field on web browser ( inserted this value on MySQL ), my Arduino that check every 1minutes this URL and if Value changed to "1" , LED on my board Turn ON and when if return "2" turn OFF .
if you have other easy way or advise to do this goal please point it,

and: how can get a value from a PHP file to Arduino sketch to use as the value on Arduino codes,


ummm, please help /:

This is quite a standard exercise. Google for:
“arduino esp switch led on and off”

In principle, your Arduino is a web client. It issues a URL which triggers your php code on a remote server. That code could interrogate a database. Your php code formats a reply as a simple web page. The Arduino parses that reply and acts on it e.g. switches a led.