Questions tagged [ob-start]

ob_start is a PHP function which turns output buffering on. While output buffering is active no output is sent from the script (other than headers), instead the output is stored in an internal buffer.

190 questions
0
votes
0 answers

All if statements rendered when using dompdf

I'm using dompdf for a results page. Statements that did not meet the condition still leave a placeholder/blank space in the PDF. I'm using ob_start to grab the HTML and pass to dompdf output -- is it saving more than just the output to the buffer?…
Klav
  • 405
  • 1
  • 9
  • 19
0
votes
2 answers

using of ob_start() is suboptimal (not optimized) and it fills the ram?

Using an output buffer requires the server to store the entire output of the PHP in RAM, so if I have a large page, I'll wind up using a fair amount of memory - and the server will also have to wait until the entire page is generated before sending…
Shafizadeh
  • 9,960
  • 12
  • 52
  • 89
0
votes
1 answer

"false" appearing next to ob_start()

I appear to have a ghost. I'm loading a page (normally loaded inside another page, if that helps, but the bug still appears when I load the page by itself) and at the top of the output, before everything else, I get a random false. It is output…
0
votes
0 answers

Including php script result as pure html

I have Wordpress and I want to add its header and footer to a different script template file. The easiest way would be just to copy and paste the html code, but then I will loose all the dynamic changes and so on. Wordpress gives a way to add header…
bodzio16
  • 15
  • 1
  • 5
0
votes
0 answers

Store echo result of javascript in a variable

Hi i'd like to store an echo's results in a variable and i want the results not the string itself... What i'm doing is: ob_start(); echo ""; $content = ob_get_clean(); echo…
behzad.robot
  • 587
  • 1
  • 5
  • 16
0
votes
1 answer

PHP: Trigger a Method and ignore the returning content

my first own question on Stackoverflow! First of all: Thank you for your help, and sorry for my bad english. ^^ I try to get the values, which a child class method gives his parent class method. The problem is, that the parent class method…
SamBrishes
  • 107
  • 1
  • 9
0
votes
2 answers

I am passing text from a bash script to php. Everything works except the mount and unmount bash commands. What am I doing wrong?

I have a bash script that mounts a usb drive, reads a text file on the usb drive, and echos that file to the php program that called it. The mount and unmount does not work. If I mount the usb from command line the php works. Evidence points to the…
lostinnow
  • 11
  • 2
0
votes
1 answer

ob_start "freeze" parameters of functions within

i'm new to ob_start and i'm in stuck with this function! i had to parse some tags within text and replace with another text returnet from a function. The problem is that when i call ob_start, functions that follow retains only the first parameters…
Robbè Meulz
  • 49
  • 1
  • 2
  • 6
0
votes
0 answers

PHP multiple ob_start() and ob_end_clean() function not work

I have this index page : ....... html+ Code in backup class…
Pink Code
  • 1,802
  • 7
  • 43
  • 65
0
votes
2 answers

how to use ob_start?

I am using PHPSavant templating system for a project and I am not sure how to use ob_start in this. I have tried before .. for example, page_header.php -- ob_start(); page_footer.php -- ob_end_flush(); But because now I am using a templating…
user187580
  • 2,275
  • 11
  • 32
  • 39
0
votes
1 answer

Compress cached output using PHP output buffers

By using this one line code ob_start('ob_gzhandler'); at the top of the page, the php output was about 11 kb according to Chrome console. When I tried to cache the output with the following code, I found the cached file was saved about 65kb. Is the…
RedGiant
  • 4,444
  • 11
  • 59
  • 146
0
votes
1 answer

How to preserve PHP include() while creating new file with ob_get_contents() and file_put_contents()

I want to create new file with dynamic contents in it using ob_start() and ob_get_contents() to grab the whole created page. Then I am using file_put_contents() to create the page with that generated content. However, the problem is, it parses the…
floCoder
  • 421
  • 1
  • 7
  • 21
0
votes
1 answer

How to check if something was echoed in php?

I'm working on a project based on some custom CMS wherein display blocks are returned by CMS's module when I call it. These blocks are drawn using custom functions I've defined across different files. Certainly, ob_start() is used already in CMS…
Sayed
  • 601
  • 6
  • 21
0
votes
3 answers

CodeIgniter, How to modify buffered output before sending

I would like to alter the output throughout my Codeigniter-based website. Quite simply I would like to do $output = str_replace( array('ā','ē','ī','ō','ū','Ā','Ē','Ī','Ō','Ū'), array('a','e','i','o','u','A','E','I','O','U'), …
B7th
  • 644
  • 1
  • 6
  • 17
0
votes
0 answers

ob_start() usage in wrapping entire project

I've started working for a new company, who to my surprise run their projects like this
buzzmonkey
  • 13
  • 2