September 2001
Intermediate to advanced
768 pages
32h 45m
English
string escapeshellarg(string arg) Makes a string safer to use as an argument for a shell command.
Returns:
Single-quote delimited string, with all other single quotes in the string quoted and escaped
Description:
escapeshellarg() converts a scalar value into a single-quote delimited string that can more safely be used as a single argument for a shell command.
Any existing single quotes (') in the value are converted to '\''. This sequence temporarily ends the single-quoted string, inserts a literal single quote, and then resumes the string. This is necessary because shells don’t interpolate the characters inside a single-quoted string.
Single-quoted strings are safer for use as shell arguments because the shell performs no variable ...
Read now
Unlock full access