在我每天使用的一個腳本中,我有這樣的東西:
<?php
$args = explode("\n", $argv[1]);
// loop through args
foreach ($args as $arg) {
// create the url
$url = 'https://trends.google.pl/trends/explore?date=now 7-d&geo=PL&q=,' . urlencode(trim($arg));
// open the url in the default browser
shell_exec('open ' . escapeshellarg($url));
}
?>
如何更改這部分
// open the url in the default browser
shell_exec('open ' . escapeshellarg($url));
在chrome瀏覽器中打開網址?因為現在它在默認瀏覽器中打開它,我不想在我的作業系統(macos)中將默認瀏覽器更改為 chrome
uj5u.com熱心網友回復:
您可以使用 -a 標志和應用程式名稱
shell_exec('open -a "Google Chrome" '.escapeshellarg($url));
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/406108.html
標籤:
上一篇:搜索功能僅使用一個引數
