I have an object, and when I am a var_dump user, I get the following:
var_dump($object); array (size=7) 'id' => int 1969 'alt' => string '' (length=0) 'title' => string 'File Name' (length=9) 'url' => string 'http://location/file.pdf' (length=24)
When I echo $object[url] , it returns string 'http://location/file.pdf' (length=24) , however, when I echo $object->url , I get null . (This sometimes works to extract values ββfrom an array, I'm just not sure in what cases or in what types of arrays)
The problem is that I am using a hosting provider with the git function, and when I push my changes, it checks the PHP code and detects a syntax error (unexpected "[") that stops the click.
My local server uses PHP 5.4.16 and the host uses 5.3.2
In a wider note, can someone point me to a resource that explains the difference between the two methods of extracting values ββfrom arrays? Really appreciate!
source share