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

孤人 提交于 2019-11-27 02:05:54

You need to be running PHP 5.4+ to use shorthand arrays

You can't have a php 5.4.3 and a 5.2.17 with a single WAMP installation, but from your error message, i think you are using the older one.

I guess, you are working with SimplXML. In this case, you should not use that line, anyway:

$media = $dc->thumbnail[0]['url'];

Note: $simpleXMLElement->childrenNodeListByName
& $simpleXMLElement['attributeValueByName']

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!