Skip to content
Advertisement

How to open link in php code being executed via command line

JavaScript

Above line does not seem to work when executing PHP scripts from command line. How best can I open links via command line?

Advertisement

Answer

A very hastily and quickly tested method might be to use exec passing in the path to a known browser with the url as it’s argument – seemed to work ok.

JavaScript

Thanks to @Álvaro’s comment the above can be simplified further( on Windows at least )

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement