PHP does not run on the browser, PHP runs in the server environment. When you access the php path on the server in the browser, you get PHP running on the server. The result is then output.
Recommended manual:php complete self-study manual
If you want to access local PHP files on the browser:
First of all, you need to build a php running environment locally. WAMP, phpstudy, and xampp are all available. Install one.
Then throw the php file into the www folder;
Enter the access path in the browser: http://localhost/your file, and you can run the PHP file to display the results.
Recommended related articles:
1.The 10 best ones in 2019 PHP development tool recommendations
2.Methods to build PHP running environment
3.PHP running environment configuration under windows
Related video recommendations:
1. Dugu Jiujian(4)_PHP video tutorial
The above is the detailed content of How to run php in browser. For more information, please follow other related articles on the PHP Chinese website!