florianv / open
使用 PHP 打开文件或 URL
1.0.0
2018-03-23 13:08 UTC
Requires
- symfony/console: ~2.3|~3.0|~4.0
- symfony/process: ~2.3|~3.0|~4.0
This package is auto-updated.
Last update: 2024-09-05 00:12:00 UTC
README
以跨平台的方式在 PHP 中打开文件或 URL。这是 node-open 的 PHP 版本。
安装
$ composer require florianv/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