Whenever you want to see a resource from a web server you send a request, this request contains information that lets the server know what it can and cant send you(encoding, supported documents, languages etc) and where to send it .
Thats a PHP script, when a user requests the script from the server it uses some of that info and returns it in an image.