Start Browser from Client-Side PHP Script

Let’s say you have a PHP script (not PHP on a web server, but simply a .php script that you run from a command line), this is one way to start/launch a browser and automatically load/navigate to a URL.


// Type "start iexplore" and press "Enter" to open Internet Explorer and view its default home screen. 
// Alternatively, type "start firefox," "start opera" or "start chrome" and press "Enter" to open one of those browsers.
pclose(popen('start iexplore &', 'r'));
//pclose(popen('start firefox -url &', 'r'));
//pclose(popen('start chrome &', 'r'));

Tags :