Posts: 38
Threads: 13
Joined: Apr 2015
Reputation:
0
when i was using file_get_contents() with CI 2, it was working as it should be as for the external pages (such as some_site.com) as for the internal pages (such as site_on_ci2.com), but with CI 3... for external file_get_contents() pages still works, for the intenal pages works but in a strange way, var_dump() shows that it contains the dom object, but when i try to fetch the elements, i get null, pls advice me how to fix it, thank u
Posts: 420
Threads: 15
Joined: Oct 2014
Reputation:
21
Isn't file_get_contents() a PHP function, and not a CI function?
Posts: 428
Threads: 0
Joined: Jan 2015
Reputation:
25
file_get_contents() only retrieves a file as a STRING. It doesn't "parse" or "execute" it. It's up to you what to do with the string. So after you retrieve a "page" using file_get_contents(), what are you trying to do with it? What are the contents of the file?
Posts: 428
Threads: 0
Joined: Jan 2015
Reputation:
25
You might start by removing all of the @'s from the function calls, which supress any error messages. You may be getting errors but not allowing yourself to view them?
Anything in your servers error logs? Php logs?
Posts: 128
Threads: 3
Joined: Feb 2015
Reputation:
7
Is the $link passed to this function same in CI2 and CI3?