473,516 Members | 3,456 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ob_start, callback and chunk_size

Hi,

I want to process the output of a script line by line before sending it out.

I thought, ob_start() with a callback function would do the job if the
callback function was called for every line. According to the manual, this
should be possible: (quote) "If the optional parameter chunk_size is passed,
the callback function is called on every first newline after chunk_size
bytes of output."

The way I understand this, if I set chunk_size to 0, the function should be
called for every newline. However, it turns out that this parameter must be
at least 2 in order to work. Why? Even more problematic is that my callback
does in fact not get called for every newline, but only once per "echo".
Why? I'm running PHP 4.3 using Maguma Studio, in other words, without an
HTTP server. Could that be the reason?

Greetings,
Thomas
Feb 1 '06 #1
0 1372

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3814
by: Christian Luszick | last post by:
hi, I am using output buffering with ob_start and a callback function, which replaces variables like "%var%" with the equivilants taken out of a mysql database. This works well! But I get sometimes php timeouts (max execution time (30s) exceeded ...). The Server should be really fast enough (dual PIII, >1 GB RAM) and runs with PHP 4.1.2 and...
0
2580
by: Phil Powell | last post by:
Based upon the following articles: http://www.experts-exchange.com/Web/Web_Languages/PHP/Q_20708448.html http://www.experts-exchange.com/Web/Web_Languages/PHP/Q_20717295.html...
0
4532
by: Phil Powell | last post by:
I traced the problem to what I believe is when I use the included content library script into the viewinterns.php page. This script will repeatedly instantiate a DateGroupHTMLGenerator class because I have to constantly produce these HTML form element fields with different names throughout my page. Here is the code I use to reproduce it...
2
6926
by: Martin | last post by:
hi, i want to use a callback function for my ob_start inside of a class. but it wont work in any way. ob_start("bar") works fine if the function is not in a class. ob_start("$foo->bar") or ob_start("Foo::bar") doesnt. Is there a way to use a function inside of a class for a callback?
0
7273
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7182
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7405
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7574
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7136
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5106
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3265
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3252
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.