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 7767425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:40:26+00:00 2026-06-01T15:40:26+00:00

I am using a cron job to get the users tweets etc and we

  • 0

I am using a cron job to get the users tweets etc and we are saving it in a text file. Now when the user visits the site we need to show these contents. Which of the following is better?

  • Curl or file_get_contents()

I researched a lot on this and found that curl is better over FGC. but all of them are for external domains. What we need is the answer for same domain.

Also can you suggest a better way for doing this? than saving it as a text file and presenting to users? Will it be more effective if we create an extra DB table for these sort of contents?

  • 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-01T15:40:27+00:00Added an answer on June 1, 2026 at 3:40 pm

    Always use file_get_contents() for getting contents of a file in filesystem. You do not need to make a HTTP request, since if the file is in your filesystem then you can simply read it there.

    For example, if you stored your tweets in a file /my-tweets/user124.txt then you can read it:

    $tweets=file_get_contents('/my-tweets/user124.txt');
    

    It’s faster than cURL, since it doesn’t make any HTTP requests and you don’t have to worry about allow_url_fopen PHP setting either.

    Also, regarding fopen() and file_get_contents(), the latter is better for code readability, unless you want to read in the tweet file line after line (in which case fopen() is a better option).

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

Sidebar

Related Questions

I need to set up a cron job that runs an executable compiled using
I'm in need of setting up a cron job using Google AppEngine which will
I need to get this file ftp://1034733:ze3Kt699vy14@idx.living.net/idx_fl_ftp_down/idx_ftmyersbeach_dn/ftmyersbeach_data.zip to my site's server. THis seems like
I want to call external urls using cron job of Google App Engine. And
I start Firefox (Linux) via command line using a cron-job. When there is no
I am using sqlalchemy job store in APS . Jobs are added too cron
using (var file_stream = File.Create(users.xml)) { var serializer = new XmlSerializer(typeof(PasswordManager)); serializer.Serialize(file_stream, this); file_stream.Close();
I am trying to setup an end-of-day automated email using a CRON job. I
I'm using PHP and a Cron Job to dynamically update a stylesheet at regular
Say I use php copy(), to get a file from a site. And then

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.