Join Up!
104882 members and counting!

 
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links 
search for in the  
previousEjecución de programasescapeshellcmdnext
Last updated: Tue, 29 Oct 2002
view the printer friendly version or the printer friendly version with notes or change language to Czech | Finnish | German

escapeshellarg

(PHP 4 >= 4.0.3)

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

Description

string escapeshellarg ( string arg)

escapeshellarg() 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(), system() and the backtick operator. A standard use would be:

system("ls ".escapeshellarg($dir));

See also exec(), popen(), system(), and the backtick operator.

User Contributed Notes
escapeshellarg
add a note about notes
There are no user contributed notes for this page.
previousEjecución de programasescapeshellcmdnext
Last updated: Tue, 29 Oct 2002
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by: http://phpbuilder.com/
Last updated: Thu Oct 31 18:34:28 2002 EST