Can I get the PHP response size inflight?How can I prevent SQL injection in PHP?Deleting an element from an array in PHPHow do I get PHP errors to display?How do I get a YouTube video thumbnail from the YouTube API?How do you parse and process HTML/XML in PHP?Reference — What does this symbol mean in PHP?Get the full URL in PHPHow does PHP 'foreach' actually work?Reference - What does this error mean in PHP?Why shouldn't I use mysql_* functions in PHP?

How can I improve my formal definitions?

How to correctly set logical high level on PS/2 port?

Punishment in pacifist society

Why does the U.S. military maintain their own weather satellites?

Why didn't Thatcher give Hong Kong to Taiwan?

Why don't "echo -e" commands seem to produce the right output?

Is Chuck the Evil Sandwich Making Guy's head actually a sandwich?

Single vs Multiple Try Catch

Quick Slitherlink Puzzles: KPK and 123

Underbrace in equation

What are the French equivalents of "blow away the cobwebs"?

Can a human variant take proficiency in initiative?

Can users with the same $HOME have separate bash histories?

Could a simple hospital oxygen mask protect from aerosol poison?

In Toy Story, are toys the only inanimate objects that become alive? And if so, why?

Can a system of three stars exist?

The 7-numbers crossword

Can UV radiation be safe for the skin?

Using font to highlight a god's speech in dialogue

How do I get my neighbour to stop disturbing with loud music?

New coworker has strange workplace requirements - how should I deal with them?

What is the practical impact of using System.Random which is not cryptographically random?

What are the electrical characteristics of a PC gameport?

Divide Numbers by 0



Can I get the PHP response size inflight?


How can I prevent SQL injection in PHP?Deleting an element from an array in PHPHow do I get PHP errors to display?How do I get a YouTube video thumbnail from the YouTube API?How do you parse and process HTML/XML in PHP?Reference — What does this symbol mean in PHP?Get the full URL in PHPHow does PHP 'foreach' actually work?Reference - What does this error mean in PHP?Why shouldn't I use mysql_* functions in PHP?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















Is it possible to get the number of bytes that have been sent back (or otherwise will be sent) to the client?



I will not use ob_start() because I cannot ensure that all output sent to the client can be guaranteed, even in the case of a fatal failure. Also, since it's an old complex web application I am not going to interfere with its output.










share|improve this question


























  • You could wrap your whole script in ob_start and ob_end_clean. Save the value of ob_end_clean and use strlen on it. Simply echo the saved value after you're done to send the actual response.

    – ccKep
    Mar 28 at 0:34







  • 1





    Might be something the webserver can do better than PHP...have a look at its logging capabilities. Unless you somehow want to use it in the code to do something more than just logging?

    – ADyson
    Mar 28 at 0:38











  • php.net/manual/en/function.ob-get-length.php

    – Alex
    Mar 28 at 0:59











  • I've updated the question to qualify that ob_start is not an option.

    – Elliot Chance
    Mar 28 at 3:14











  • For what purpose do you need this? It matters, because there are lots of places to get this data, each with varying degrees of accuracy and conditions.

    – Brad
    Mar 28 at 3:23

















0















Is it possible to get the number of bytes that have been sent back (or otherwise will be sent) to the client?



I will not use ob_start() because I cannot ensure that all output sent to the client can be guaranteed, even in the case of a fatal failure. Also, since it's an old complex web application I am not going to interfere with its output.










share|improve this question


























  • You could wrap your whole script in ob_start and ob_end_clean. Save the value of ob_end_clean and use strlen on it. Simply echo the saved value after you're done to send the actual response.

    – ccKep
    Mar 28 at 0:34







  • 1





    Might be something the webserver can do better than PHP...have a look at its logging capabilities. Unless you somehow want to use it in the code to do something more than just logging?

    – ADyson
    Mar 28 at 0:38











  • php.net/manual/en/function.ob-get-length.php

    – Alex
    Mar 28 at 0:59











  • I've updated the question to qualify that ob_start is not an option.

    – Elliot Chance
    Mar 28 at 3:14











  • For what purpose do you need this? It matters, because there are lots of places to get this data, each with varying degrees of accuracy and conditions.

    – Brad
    Mar 28 at 3:23













0












0








0








Is it possible to get the number of bytes that have been sent back (or otherwise will be sent) to the client?



I will not use ob_start() because I cannot ensure that all output sent to the client can be guaranteed, even in the case of a fatal failure. Also, since it's an old complex web application I am not going to interfere with its output.










share|improve this question
















Is it possible to get the number of bytes that have been sent back (or otherwise will be sent) to the client?



I will not use ob_start() because I cannot ensure that all output sent to the client can be guaranteed, even in the case of a fatal failure. Also, since it's an old complex web application I am not going to interfere with its output.







php






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 3:14







Elliot Chance

















asked Mar 28 at 0:31









Elliot ChanceElliot Chance

2,5505 gold badges29 silver badges54 bronze badges




2,5505 gold badges29 silver badges54 bronze badges















  • You could wrap your whole script in ob_start and ob_end_clean. Save the value of ob_end_clean and use strlen on it. Simply echo the saved value after you're done to send the actual response.

    – ccKep
    Mar 28 at 0:34







  • 1





    Might be something the webserver can do better than PHP...have a look at its logging capabilities. Unless you somehow want to use it in the code to do something more than just logging?

    – ADyson
    Mar 28 at 0:38











  • php.net/manual/en/function.ob-get-length.php

    – Alex
    Mar 28 at 0:59











  • I've updated the question to qualify that ob_start is not an option.

    – Elliot Chance
    Mar 28 at 3:14











  • For what purpose do you need this? It matters, because there are lots of places to get this data, each with varying degrees of accuracy and conditions.

    – Brad
    Mar 28 at 3:23

















  • You could wrap your whole script in ob_start and ob_end_clean. Save the value of ob_end_clean and use strlen on it. Simply echo the saved value after you're done to send the actual response.

    – ccKep
    Mar 28 at 0:34







  • 1





    Might be something the webserver can do better than PHP...have a look at its logging capabilities. Unless you somehow want to use it in the code to do something more than just logging?

    – ADyson
    Mar 28 at 0:38











  • php.net/manual/en/function.ob-get-length.php

    – Alex
    Mar 28 at 0:59











  • I've updated the question to qualify that ob_start is not an option.

    – Elliot Chance
    Mar 28 at 3:14











  • For what purpose do you need this? It matters, because there are lots of places to get this data, each with varying degrees of accuracy and conditions.

    – Brad
    Mar 28 at 3:23
















You could wrap your whole script in ob_start and ob_end_clean. Save the value of ob_end_clean and use strlen on it. Simply echo the saved value after you're done to send the actual response.

– ccKep
Mar 28 at 0:34






You could wrap your whole script in ob_start and ob_end_clean. Save the value of ob_end_clean and use strlen on it. Simply echo the saved value after you're done to send the actual response.

– ccKep
Mar 28 at 0:34





1




1





Might be something the webserver can do better than PHP...have a look at its logging capabilities. Unless you somehow want to use it in the code to do something more than just logging?

– ADyson
Mar 28 at 0:38





Might be something the webserver can do better than PHP...have a look at its logging capabilities. Unless you somehow want to use it in the code to do something more than just logging?

– ADyson
Mar 28 at 0:38













php.net/manual/en/function.ob-get-length.php

– Alex
Mar 28 at 0:59





php.net/manual/en/function.ob-get-length.php

– Alex
Mar 28 at 0:59













I've updated the question to qualify that ob_start is not an option.

– Elliot Chance
Mar 28 at 3:14





I've updated the question to qualify that ob_start is not an option.

– Elliot Chance
Mar 28 at 3:14













For what purpose do you need this? It matters, because there are lots of places to get this data, each with varying degrees of accuracy and conditions.

– Brad
Mar 28 at 3:23





For what purpose do you need this? It matters, because there are lots of places to get this data, each with varying degrees of accuracy and conditions.

– Brad
Mar 28 at 3:23












1 Answer
1






active

oldest

votes


















0















No.



Theoretically a SAPI could count that, but in most cases this doesn't serve any purpose so it'S not done.






share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55388466%2fcan-i-get-the-php-response-size-inflight%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0















    No.



    Theoretically a SAPI could count that, but in most cases this doesn't serve any purpose so it'S not done.






    share|improve this answer





























      0















      No.



      Theoretically a SAPI could count that, but in most cases this doesn't serve any purpose so it'S not done.






      share|improve this answer



























        0














        0










        0









        No.



        Theoretically a SAPI could count that, but in most cases this doesn't serve any purpose so it'S not done.






        share|improve this answer













        No.



        Theoretically a SAPI could count that, but in most cases this doesn't serve any purpose so it'S not done.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 28 at 3:19









        johannesjohannes

        13.6k1 gold badge35 silver badges55 bronze badges




        13.6k1 gold badge35 silver badges55 bronze badges





















            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55388466%2fcan-i-get-the-php-response-size-inflight%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript