file_get_contents() and CI 3.0.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
Isn't file_get_contents() a PHP function, and not a CI function?
Website: http://avenir.ro
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?
(06-12-2015, 07:06 AM)CroNiX Wrote: 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? this is my parse function PHP Code: function parse($link) this function works for the external pages but for the internal pages if only i am using 2.0, if i am using 3.0, it doesn't work
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? (06-12-2015, 12:21 PM)CroNiX Wrote: 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? no error is shown, neither with @ nor without, no error log, there is no error at all, the result is i get the dom object (var_dump returns object stdclass with length and children), but if i try to call its child, it returns null |
Welcome Guest, Not a member yet? Register Sign In |