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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:55:42+00:00 2026-06-03T04:55:42+00:00

I am working on a SEO system for my project and am optimizing all

  • 0

I am working on a SEO system for my project and am optimizing all links with a single page.

Excerpt from .htaccess file:

RewriteRule ^(.+)$ seo.php [L,QSA]

This SEO file (seo.php) will get the requested path and parse it to be as valid url into my script.

I am using include('cat.php?catid=1') at the end of seo.php and everything is working fine, but I wonder which is faster: include() or file_get_contents()?

When I use file_get_content('cat.php?catid=1'), it displays the source of the PHP file, but when I use file_get_content('http://localhost/cat.php?catid=1'), it displays the normal page.

So, which is faster: file_get_content() or include()?

  • 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-03T04:55:44+00:00Added an answer on June 3, 2026 at 4:55 am

    They are of course different

    • Include will parse PHP code inside it
    • file_get_contents will return just the content

    So if yuo want just to retrive the html content of page use file_get_contents otherwise if you need to parse PHP code use include();

    Notice: if you want to retrive the content of a page hosted on your website you should use local path not web path to your resource, ie:

    • Do: file_get_contents('/home/user/site/file.html');
    • Do Not: file_get_contents('http://example.com/file.html');
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is working for changing my crappy urls to SEO friendly URLs: ^([0-9]+)/[a-z-]+/?$ /details.php?id=$1
I'm working on an aircraft website and using a .htaccess file to rewrite the
I am working with SEO PHP scripts and I am just following Google SEO
I am working with SQL Server 2005. I need to select all rows from
I am working on a new project, I want to create SEO friendly URL's
I am working on creating Google style SEO rules with .htaccess and I am
I'm a student working on a project related to SEO; I need to write
for SEO reasons we are issuing a 301 redirect from the code. Its working
Working on a page with multiple sections. at the very top there is a
Working on my first Rails project, I used Ryan Bates' Nifty-Generators to create the

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.