05.05.2013 Views

Programming PHP

Programming PHP

Programming PHP

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Any number of these options can be ORed together, so that errors in each of the levels are<br />

reported. For example, the following code turns off user errors and warnings, performs<br />

some actions, then restores the original level:<br />

<br />

escapeshellarg<br />

string escapeshellarg(string argument)<br />

Properly escapes argument so it can be used as a safe argument to a shell function. When<br />

directly passing user input (such as from forms) to a shell command, you should use this<br />

function to escape the data to ensure that the argument isn’t a security risk.<br />

escapeshellcmd<br />

string escapeshellcmd(string command)<br />

Escapes any characters in command that could cause a shell command to run additional<br />

commands. When directly passing user input (such as from forms) to the exec( ) or<br />

system( ) functions, you should use this function to escape the data to ensure that the argument<br />

isn’t a security risk.<br />

exec<br />

string exec(string command[, array output[, int return]])<br />

Executes command via the shell and returns the last line of output from the command’s<br />

result. If output is specified, it is filled with the lines returned by the command. If return is<br />

specified, it is set to the return status of the command.<br />

If you want to have the results of the command output into the <strong>PHP</strong> page, use passthru( ).<br />

exp<br />

E_CORE_WARNING Warnings generated internally by <strong>PHP</strong><br />

E_COMPILE_ERROR Errors generated internally by the Zend scripting engine<br />

E_COMPILE_WARNING Warnings generated internally by the Zend scripting engine<br />

E_USER_ERROR Runtime errors generated by a call to trigger_error( )<br />

E_USER_WARNING Runtime warnings generated by a call to trigger_error( )<br />

E_ALL All of the above options<br />

double exp(double number)<br />

Returns e raised to the number power.<br />

396 | Appendix A: Function Reference<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2002 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!