PHPackages                             divinity76/phpquoteshellarg - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. divinity76/phpquoteshellarg

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

divinity76/phpquoteshellarg
===========================

php quote shell arguments

v1.0.2(1y ago)0763UnlicensePHPPHP &gt;=7.2

Since Jul 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/divinity76/phpquoteshellarg)[ Packagist](https://packagist.org/packages/divinity76/phpquoteshellarg)[ Docs](https://github.com/divinity76/phprouter)[ RSS](/packages/divinity76-phpquoteshellarg/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

phpquoteshellarg
================

[](#phpquoteshellarg)

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
============

[](#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
=====

[](#usage)

```
