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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:46:23+00:00 2026-05-27T13:46:23+00:00

Need a bit of PHP help here, the included content is appearing as ‘1’

  • 0

Need a bit of PHP help here, the included content is appearing as ‘1’ which means that its true but need it’s contents to appear and im unsure why it isn’t. Here is a shortened version of a function:

public function content {
    $website->content = 'Some content here. ';
    ob_start();
    include('myfile.php');
    $file_content = ob_end_clean();
    $website->content .= $file_content;
    $website->content .= ' Some more content here.';
     echo $website->content;
}

This outputs:

Some content here 
1 
Some more content here

When I need it to output:

Some content here
'Included file content here'
Some more content here

Any idea’s how I can fix this?

  • 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-27T13:46:23+00:00Added an answer on May 27, 2026 at 1:46 pm

    Try using ob_get_clean() instead of ob_end_clean().

    Both clear the current buffer but ob_end_clean() returns a boolean, whereas ob_get_clean() returns the contents of the current buffer.

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

Sidebar

Related Questions

I have a bit of PHP code which I need to return an even
I am a bit new to sql and php so I need some help
( First time programming in PHP. Had some help. Need a bit more. )
I need a little bit of help here. First off, I am not sure
Just need a little bit of Javascript to warn people that press the back
I'm a SQL noob, and I need a little bit of help understanding the
I need to write a bit of SQL which parses the second word of
I need to integrate some legacy 32-bit code - for which I don't have
I need some help understanding this bit of code pre { white-space: pre; white-space:
I need a cross-platform library/algorithm that will convert between 32-bit and 16-bit floating point

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.