I have this linecode
$media = $dc->thumbnail->attributes()['url'];
runs fine on my local (WAMP) php 5.4.3 but when i host it on my server cpanel then it gives this error
Parse error: syntax error, unexpected '[', expecting ')'
the php version on my server is 5.2.17
i dnt see any problem with it, please help
How To Fix parse error syntax error unexpected ' ' in wordpress Via FTP? In order to fix the Syntax Error in WordPress you need to edit the code that caused this error. The only possible way to resolve the syntax error is to directly exchange the faulty code via FTP or access the file you last edited using FTP.
A parse error: syntax error, unexpected appears when the PHP interpreter detects a missing element. Most of the time, it is caused by a missing curly bracket “}”. To solve this, it will require you to scan the entire file to find the source of the error.
If the PHP code contains a syntax error, the PHP parser cannot interpret the code and stops working. For example, a syntax error can be a forgotten quotation mark, a missing semicolon at the end of a line, missing parenthesis, or extra characters.
You need to be running PHP 5.4+ to use shorthand arrays
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With