It produces this result: object(DOMNodeList)#2 (0) { }
How do I see what’s in it? var_dump will display the contents of a “normal” array. How do I display the contents of a “object” array. I’m new to objects and don’t know which keywords to google.
Note Bene: fopen wrappers must be enabled for this to work. Some server admins may disable this for security reasons, in which event cURL should be used. So if anyone tries this and it doesn’t work, that’s likely why.
Also, even if URL fopen is enabled, file_get_contents() can fail if the remote server checks the user agent of the request. Sometimes the default one is blocked. Twitter RSS feeds, for example, don’t like the default User Agent of my web server. You can set the user agent in file_get_contents() but it’s just as easy to use cURL in these cases.