florianv/open

使用 PHP 打开文件或 URL

安装: 287

依赖: 0

建议者: 0

安全: 0

星标: 2

关注者: 2

分支: 5

开放问题: 3

语言:Shell

1.0.0 2018-03-23 13:08 UTC

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

许可证

MIT