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
1 answer

PHP OB_START which double quotes

i'm using php on_start and ob_get_contents to echo html and store in a variable. However when I json encode and check the output it doesn't output the entire string. Could anyone help point out what I'm doing wrong ob_start(); echo'
Kwaasi Djin
  • 79
  • 2
  • 10
0
votes
1 answer

How to gracefully tell client the transmission is finished so the browser will display the page immediately?

Greeting guys, I'm working on my php framework. It has a response manager to wrapper php's header, cookie, and buffer functions. I use this to send result page to user. However, even the page header and contents already be sent by using ob_start ->…
user2328799
0
votes
3 answers

Issue sending html email with images in php

I have two HTML templates. And I buffer them into php email using ob_start() and ob_get_clean(). However, one can be sent without any problem while another has no images in the email body. Can anyone find what the problems are? Here are the two…
Andrew Liu
  • 2,478
  • 5
  • 22
  • 29
0
votes
1 answer

php code becomes xml?

I'm trying to evaluate the contents of mapvar.php and saving it to a variable. This is the code:
chintogtokh
  • 803
  • 1
  • 10
  • 25
0
votes
1 answer

Using ob_ stuff inside a function and call it more than once

I just discovered, with my great surprise, that I can't use ob_ functions inside a user defined function and call this function more than once, because the second output never comes out Here are my simplified files index.php function foo($data){ …
Ivan
  • 2,463
  • 6
  • 39
  • 51
0
votes
0 answers

PHP ob_start include a file which include a file

I try to cache a php file. This php file is just an HTML file with some include and variable in it. I want to execute this php file one time and then put it in an .html file. I tried : ob_start(); include('source.php'); $file_content =…
pol
  • 46
  • 1
  • 8
0
votes
1 answer

Email doesn't contain first few lines got by output buffer php

I have a php script containing a function which when run gives output. I am using that output as output buffer by using ob_start and ob_get_clean functions and emailing that output which contains some html as a report. Problem is, email doesn't…
g13
  • 139
  • 4
  • 11
0
votes
2 answers

ob_start() works fine in local but giving error on hosting

I am using PHP addressbook for an web application with some additional features. Everything works fine when I tested it in my local machine using Xampp but when I hosted it in a online webserver it throws the following error…
user1999891
0
votes
0 answers

Ruby on Rails ob_start to remove HTML line break?

When using PHP in a simple HTML page like: I could use ob_start() and ob_end_flush() and then str_replace the \n to do something like: saving the…
jk jk
  • 1,027
  • 2
  • 13
  • 28
0
votes
3 answers

Parallel processing in PHP?

My website has source pages that use ob_start() and $content = ob_get_clean(). Inside them I'm using a function multiple times that uses curl and bing to translate words/phrases into a specified language. If the translation has been done before it…
Luke Wenke
  • 1,149
  • 2
  • 23
  • 43
0
votes
0 answers

Few problems at the same time, PHP

I'm working on one website but i'm confused.
0
votes
1 answer

Strange behavior ob_start. Kohana

Firstly I'm sorry for my bad english. So on localhost all well and good, but on web server displays incomprehensible numbers with symbols, for example 326e. It seems to have found a problem spot .. only what the problem is I can not understand…
Winston
  • 1,758
  • 2
  • 17
  • 29
0
votes
1 answer

How to get scripts output and process in another script in PHP using ob_start?

OK look: What I want to do is the following (this is an example): $output = require( "script_execution.php" ); echo str_replace( "hello", "bye", $output ); The solution I have: (script_execution.php)
CRISHK Corporation
  • 2,948
  • 6
  • 37
  • 52
0
votes
3 answers

ob_end_clean modifies variables as well

Here is a sample code: ob_start(); include("test.ini"); $string = ob_get_contents(); echo "
"; echo "string: ".$string; and the output: testing = ini string: testing = ini When I add ob_end_clean(); at the end of the code above there is no…
Koray Tugay
  • 22,894
  • 45
  • 188
  • 319