在PHP中打开文件或URL

2.0.0 2020-07-20 15:18 UTC

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

许可证

MIT