php - Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' -


i have line in php:

  function remove_dangerous_chars($src) {         $list = array( '$', '\', '"', '\', '_request', '_get', '_post', '_cookie', '_files', '_server', '_env', 'globals', '_session', 'toupper' ); 

when run it, error:

parse error: syntax error unexpected t_constant_encapsed_string, expecting ')'

you need escape character, backslash, in array -

$list = array( '$', '\\', '"', '_request', '_get', '_post', '_cookie', '_files', '_server', '_env', 'globals', '_session', 'toupper' ); 

and need backslash once in array.


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -