0

I'm getting an error and I don't know how to resolve it.

The error is :

Parse error: syntax error, unexpected '[', expecting ')'

Code is :

$message = str_replace(['\\', '"'], ['', '"'], crtl_data($_POST['message']));

I have checked the whole line but there seems no errors in there ? What is going wrong here ?

  • 3
    Upgrade PHP..... – AbraCadaver Mar 19 '18 at 20:05
  • I can't. Other alternative ? –  Mar 19 '18 at 20:07
  • https://stackoverflow.com/questions/12769982/reference-what-does-this-error-mean-in-php/22316776#22316776 – AbraCadaver Mar 19 '18 at 20:09
  • Please reconsider upgrading PHP. I know it can be a pain, but if you're on PHP 5.3 or earlier your site is in _really_ bad shape: [PHP 5.3 hasn't had a release (not even for security fixes) in over 3.5 _years_](http://php.net/eol.php). – Chris Mar 19 '18 at 20:18

0 Answers0