divinity76/phpquoteshellarg
Composer 安装命令:
composer require divinity76/phpquoteshellarg
包简介
php quote shell arguments
README 文档
README
php quote shell arguments function because php's escapeshellarg() function is broken:
$str="æøå\x01";
var_dump(["str"=>$str,"escapeshellarg"=>escapeshellarg($str), "quoteshellarg"=>quoteshellarg($str)]);
=>
array(3) {
["str"]=>
string(7) "æøå�"
["escapeshellarg"]=>
string(3) "'�'"
["quoteshellarg"]=>
string(9) "'æøå�'"
}
installation
the script is just a standalone .php file, you can just copypaste it.
another alternative is to use composer:
composer require 'divinity76/phpquoteshellarg'
usage
<?php
require_once(__DIR__ . '/vendor/autoload.php');
use function Divinity76\quoteshellarg\quoteshellarg;
$str="æøå\x01";
var_dump(["str"=>$str,"escapeshellarg"=>escapeshellarg($str), "quoteshellarg"=>quoteshellarg($str)]);
may outputs something like
array(3) {
["str"]=>
string(7) "æøå�"
["escapeshellarg"]=>
string(3) "'�'"
["quoteshellarg"]=>
string(9) "'æøå�'"
}
统计信息
- 总下载量: 76
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unlicense
- 更新时间: 2022-07-04