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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:22:11+00:00 2026-05-18T04:22:11+00:00

Hello is there a way to take the content of a php file while

  • 0

Hello is there a way to take the content of a php file while processing the php code in it?
I need to include a code into another page but I need to print the content it in a specific position.

If I use include the code will be printed before the html tag of course cause it’s processed before the page, but if I use file_get_contents the content is taken in the page but if I have some php tags I’ll get those too as plain text.

Thank you.

EDIT: sorry guys seems like I was drunk while I was writing. I corrected.

I have an engine that processes the page contents, puts them into a variable and then print them in a specific position within the html page. In the engine I need to “embed” the code of other “static” pages that could have some php tags. If I use file_get_contents I will get the content as plain text (with php tags not parsed) if I use include it just won’t work cause it’s not the function for it. So I what I need is to embed the PROCESSED code into the engine (as ready-to-be-printed HTML).

  • 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-05-18T04:22:12+00:00Added an answer on May 18, 2026 at 4:22 am

    You can use an output buffer to include a PHP file but save the resulting output for later use instead of printing it immediately to the browser.

    ob_start();
    include('path/to/file.php');
    $output = ob_get_contents();
    ob_end_clean();
    
    // now do something with $output
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to take substrings of a string with .bat/.cmd files? For
Hello there and Merry Christmas !!! I am new to WPF and I am
Is there the equivalent of the Hello World program for GIS applications? I am
Hello I want a silverlight grid layout panel. The width should be 100%. There
Hullo all, Wondering if there are any Java hackers who can clue me in
We are using PowerDesigner at work for database modelling. But there is a hell
Hello I have the following error by git-fsck, which cannot be cleaned by git-gc
Hello again ladies and gents! OK, following on from my other question on ASP.NET
Hello I was writing a Regular Expression (first time in my life I might
Hello can anybody solve this please I'm creating the object in the action class

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.