likesistemas / open
在PHP中打开文件或URL
2.0.0
2020-07-20 15:18 UTC
Requires
- php: >=7.2.5
- symfony/console: ^5.0
- symfony/process: ^5.0
This package is auto-updated.
Last update: 2024-09-21 03:22:12 UTC
README
以跨平台方式在PHP中打开文件或URL。这是node-open的PHP端口。
安装
$ composer require likesistemas/open
使用
实用工具
使用open()
方法使用默认或特定应用程序打开文件或URL
use Open\Open; Open::open('picture.jpg'); // It will use the default browser Open::open('http://google.com'); // It will try to use Chrome Open::open('http://google.com', 'chrome');
命令
使用默认浏览器打开Google
$ php bin/open http://google.com
使用指定的浏览器(firefox)打开Google
$ php bin/open http://google.com firefox