Current location: Hot Scripts Forums » Programming Languages » PHP » ob_flush


ob_flush

Reply
  #1 (permalink)  
Old 06-16-04, 01:20 AM
kurdapya kurdapya is offline
Newbie Coder
 
Join Date: Dec 2003
Location: philippines
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
ob_flush

ppl... can u give me good example of using the ob_flush and ob_end_flush (for database)...
whoever would want to help...thanks... *tsup*
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 06-16-04, 02:38 AM
Worm's Avatar
Worm Worm is offline
Newbie Coder
 
Join Date: Jun 2004
Location: Germany, Frankfurt am Main
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kurdapya
ppl... can u give me good example of using the ob_flush and ob_end_flush (for database)...
whoever would want to help...thanks... *tsup*
rtfm, i've never used one of them not in php...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 06-16-04, 03:07 AM
kurdapya kurdapya is offline
Newbie Coder
 
Join Date: Dec 2003
Location: philippines
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
u think i would still ask here if i've understood the manual.. ?
AND I SAID I WANT EXAMPLES...... and next time... dont reply if u dont know any example.. thanks nway....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 06-16-04, 03:48 AM
Worm's Avatar
Worm Worm is offline
Newbie Coder
 
Join Date: Jun 2004
Location: Germany, Frankfurt am Main
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kurdapya
u think i would still ask here if i've understood the manual.. ?
AND I SAID I WANT EXAMPLES...... and next time... dont reply if u dont know any example.. thanks nway....
I READ YOU WANT EXAMPLES and next time better dont make guidelines how to behave in here, its not up to you. Anyways:

PHP Code:

<?php


function callback($buffer) {

  
// replace all the apples with oranges
  
return (ereg_replace("apples""oranges"$buffer));

}

ob_start("callback");

?>

<html>
<body>
<p>It's like comparing apples to oranges.
</body>
</html>

<?php

ob_end_flush
();

?>
ob_flush() or just flush() are functions depending on many others. You can start a "buffered area" in your browser, using ob_start(). Everything usually output by the browser will be buffered in an internal buffer until the script recieves the ob_end_flush(). Now everything inbetween ob_start() and ob_end_flush() will be send to the browser. The Difference between ob_flush() and ob_end_flush() is just, that ob_flush() does not stop the buffering but just output everything what has been buffered since ob_start() but continue buffering until it is stopped by ob_end_flush().
The example above will output:

PHP Code:

<html>

<
body>
<
p>It's like comparing oranges to oranges.
</body>
</html> 
FYI:

ob_start([callback function]) - Starts an output buffering session.
ob_flush() - Send the contents of the buffer to the client and clear the buffer.
ob_get_contents() - Returns the contents of the buffer. The buffer is not cleared.
ob_end_clean() - Ends the current buffering session and purges the buffer.
ob_end_flush() - Ends the current buffering session and displays the buffer.
ob_get_length() - (Version >= 4.0.2) Return the size of the current buffer.
ob_get_clean() - (Version >= 4.3) Composite of ob_get_contents() and ob_end_clean(). The buffer is returned and the session ends.

Last edited by Worm; 06-16-04 at 04:03 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 06-16-04, 04:39 AM
kurdapya kurdapya is offline
Newbie Coder
 
Join Date: Dec 2003
Location: philippines
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
no thanks.. i already got helped...
well did u check your attitude??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 06-16-04, 04:44 AM
Worm's Avatar
Worm Worm is offline
Newbie Coder
 
Join Date: Jun 2004
Location: Germany, Frankfurt am Main
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kurdapya
no thanks.. i already got helped...
well did u check your attitude??
without bothering you, you could check yours aswell. maybe its just beeing frustrated because of me not coming up with an expample but there are other ways to show it, more polite... but as you should be able to see, i looked around for YOU to find an example so no reason for beeing impolite...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 06-16-04, 04:47 AM
Rapid Dr3am Rapid Dr3am is offline
Community VIP
 
Join Date: Jan 2004
Location: Liverpool, England
Posts: 752
Thanks: 0
Thanked 0 Times in 0 Posts
Please refrain from flaming within this forum.
__________________
Placeholder, place signature here.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #8 (permalink)  
Old 06-16-04, 05:01 AM
Worm's Avatar
Worm Worm is offline
Newbie Coder
 
Join Date: Jun 2004
Location: Germany, Frankfurt am Main
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Rapid Dr3am
Please refrain from flaming within this forum.
Of course...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #9 (permalink)  
Old 06-16-04, 05:20 AM
Rapid Dr3am Rapid Dr3am is offline
Community VIP
 
Join Date: Jan 2004
Location: Liverpool, England
Posts: 752
Thanks: 0
Thanked 0 Times in 0 Posts
Thank you.
__________________
Placeholder, place signature here.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #10 (permalink)  
Old 06-16-04, 05:27 AM
Worm's Avatar
Worm Worm is offline
Newbie Coder
 
Join Date: Jun 2004
Location: Germany, Frankfurt am Main
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Rapid Dr3am
Thank you.
For you, just the Best !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 11:12 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.