In a typical web application, where is PHP code executed?
Options
- A. In the web browser
- B. On the web server
- C. Inside the HTML document by CSS
- D. More than one of the above
- E. None of the above
Quiz Practice:
B. On the web server
Correct Answer: On the web server.
PHP is a server-side scripting language. When a browser requests a PHP page, the request reaches the web server.
The server processes the PHP code and generates a response. Usually, the response contains HTML, CSS, JavaScript or other data that is sent back to the browser.
The browser normally receives the generated output rather than executing the original PHP code itself.
Simple flow:
Browser → Web Server → PHP processing → Response → Browser