Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9242879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:40:51+00:00 2026-06-18T08:40:51+00:00

I want to list 10.000 pages in the screen using php function file_get_contents to

  • 0

I want to list 10.000 pages in the screen using php function file_get_contents to get information for a db.

This works until about page 500, then the script stops running (the page has loaded) and displays no error.

<?php

for ($nr=1; $nr<=10000; $nr++){

$url = "http://site.com/u$nr";
$string = file_get_contents($url);

echo '<textarea>'.$string.'</textarea>';

}

?>

@edit

I want to get this information for my computer to be manipulated via Javascript, I think that gives a lot of work to manipulate HTML using PHP.
Record these pages in db is a good idea.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T08:40:53+00:00Added an answer on June 18, 2026 at 8:40 am

    I’d advice to set your time_limit inside the loop. Setting the time-limit will ‘extend’ timeout with the given amount of time;

    <?php 
    for ($nr=1; $nr<=10000; $nr++){
        $url = "http://site.com/u$nr";
        $string = file_get_contents($url);
        echo '<textarea>'.$string.'</textarea>';
    
        // extend the time-limit with this amount of time,
        // the amount of time this request is allowed to take
        set_time_limit(5);
    }
    
    ?>
    

    This way you won’t have to calculate the ‘total’ time limit for 10.000 records, and don’t allow a single request to take (for example) 1 hour to complete

    [update]
    New information posted by the OP states that he wants to process the inputs using javascript. Therefore, a better solution will be to fetch all pages 1 at a time using jQuery, process the information and submit the results to the database, using a Ajax post and server-side saving it to the database

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to list all files on an FTP server using PHP. According to
I'm using Directory.GetFiles() to list files according to given pattern. This works fine for
I want to create a list using an iterator that will go to 100,000
I want to create a large (~300,000 entries) List of self defined objects of
i am trying to build a statics system i want list all pages in
I want to list all files in a directory Using PyroCMS. Using the Files
I want to list combinations of o & 1 recursively using c depending on
I have a list from 10,000 long value and I want to compare that
i have a list (1,000,000 emails addresses) of my customers and i want to
I am currently using PHP to paginate my data from mysql. I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.