Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    May 2009
    Location
    Pennsylvania, United States
    Posts
    54
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Question ob_start question

    I've started looking into the output buffering functions in the manual, I think I sort of understand what they're user for, but I'm not 100% sure.

    For example:

    PHP Code:
    <?php
    if(is_authorized()) {
    ob_start();
    echo 
    "Hello, your are logged in!";


    if(isSet(
    $_GET['action']) && $_GET['action'] == 'home') {
    ob_end_flush();
    // some more out put here! 
    }

    ob_end_clean();

    ?>
    Is that a correct way to use these functions...can someone please explain?!

    Thanks! :]

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,853
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Is that a correct way to use these functions...can someone please explain?!
    Do you really need to use that function? It's not a good practice to rely much on this as it may take more resources from server. You could avoid use of it by a wise design of your system.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •