Answer the question
In order to leave comments, you need to log in
Why does the file_get_html function return the same page when substituting different links?
I'm trying to parse a simple forum using the simple_html_dom php library. Formed an array containing links to pages that need to be processed. I run through this array in a loop and substitute a link to the page as an argument into the file_get_html function. A list of topics and links to them is taken from each page, and all of them are added to an associative array. However, instead of requesting a new page each time (according to the array), the same (first) page is constantly requested and the same list of topics is added to the resulting array.
PS Later, I found a function that receives the web page code not through this library, but it behaves similarly in a loop. Help, what am I doing wrong?
PPS print_var is a library that prints associative arrays in human-readable form.
Script code: pastebin.com/5YZWmstw
Answer the question
In order to leave comments, you need to log in
Before line 56 add:
I don’t know if the link will be available:
https://ide.c9.io/ravshanium/demo-project
seems to need to register, if there is another place where php can be tested online, write.
Check $pageLinks to see if the correct links are actually going there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question