: Does browser understand PHP? I know that PHP is server side scripting language, but I got confused when asked in an interview if the browser understands PHP? I have Apache installed in my system.
I know that PHP is server side scripting language, but I got confused when asked in an interview if the browser understands PHP?
I have Apache installed in my system.
If in a PHP file I write <?php echo 'HELLO' ?> and I open it in a browser it shows HELLO.
Now how does it happen if the browser does not understand PHP?
More posts by @Gail5422790
1 Comments
Sorted by latest first Latest Oldest Best
The browser does not understand PHP. Like you have stated, it is a server-side scripting language.
If you are seeing 'HELLO' output in the browser then your script must have been run through the PHP interpreter on the webserver and the resulting output (ie. 'HELLO') is returned in the response that is sent to the browser.
However, if your PHP script is in an ordinary HTML file (that is not parsed by the PHP interpreter) or not located on a webserver with PHP installed then you will not see anything output in the browser in this instance. If you viewed the source of your page you would see the unprocessed PHP code.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.