fer0an Posted October 6, 2010 Share Posted October 6, 2010 hello I want using while and for in my code anyone can help me? I want download a webpage using get_content. this page have 10 sub link and I want them. so I use this codes : //number of website pages $i=1; while ($i<=4) { //download a webpage $maincatst = file_get_contents($catlink.$i); $i++; //number of sub link in a page for ($j=1;$j<=10;$j++) { // download sub link content $main_post_str = file_get_contents($link); } } but I can't get them my result is : downloaded page 1 and first sub link then page 2 and first sub link ...page 4 and first sublink. anyone can help me to download page 1 and 10 sub link then ....page 4 and 10 sub link? thank you Link to comment https://forums.phpfreaks.com/topic/215278-while-and-for/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.