escapeshellarg(3) php man page | unix.com

Man Page: escapeshellarg

Operating Environment: php

Section: 3

ESCAPESHELLARG(3)							 1							 ESCAPESHELLARG(3)

escapeshellarg - Escape a string to be used as a shell argument

SYNOPSIS
string escapeshellarg (string $arg)
DESCRIPTION
escapeshellarg(3) adds single quotes around a string and quotes/escapes any existing single quotes allowing you to pass a string directly to a shell function and having it be treated as a single safe argument. This function should be used to escape individual arguments to shell functions coming from user input. The shell functions include exec(3), system(3) and the backtick operator. On Windows, escapeshellarg(3) instead removes percent signs, replaces double quotes with spaces and adds double quotes around the string.
PARAMETERS
o $arg - The argument that will be escaped.
RETURN VALUES
The escaped string.
EXAMPLES
Example #1 escapeshellarg(3) example <?php system('ls '.escapeshellarg($dir)); ?>
SEE ALSO
escapeshellcmd(3), exec(3), popen(3), system(3), backtick operator. PHP Documentation Group ESCAPESHELLARG(3)
Related Man Pages
htmlspecialchars_decode(3) - php
pg_escape_string(3) - php
system(3) - php
exec(3) - php
pg_escape_identifier(3) - php
Similar Topics in the Unix Linux Community
Removal of comma(,) present inbetween double quotes(&quot; &quot;)
Replace double quotes with a single quote within a double quoted string
Get nth occurence of string from a file
Remove Carriage Return (CRLF) within double quotes
Complex: bash, using ANSI-C quotes in skript