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;
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
add a comment |
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
You could wrap your whole script inob_start
andob_end_clean
. Save the value ofob_end_clean
and usestrlen
on it. Simplyecho
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
add a comment |
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
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
php
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 inob_start
andob_end_clean
. Save the value ofob_end_clean
and usestrlen
on it. Simplyecho
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
add a comment |
You could wrap your whole script inob_start
andob_end_clean
. Save the value ofob_end_clean
and usestrlen
on it. Simplyecho
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
add a comment |
1 Answer
1
active
oldest
votes
No.
Theoretically a SAPI could count that, but in most cases this doesn't serve any purpose so it'S not done.
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
No.
Theoretically a SAPI could count that, but in most cases this doesn't serve any purpose so it'S not done.
add a comment |
No.
Theoretically a SAPI could count that, but in most cases this doesn't serve any purpose so it'S not done.
add a comment |
No.
Theoretically a SAPI could count that, but in most cases this doesn't serve any purpose so it'S not done.
No.
Theoretically a SAPI could count that, but in most cases this doesn't serve any purpose so it'S not done.
answered Mar 28 at 3:19
johannesjohannes
13.6k1 gold badge35 silver badges55 bronze badges
13.6k1 gold badge35 silver badges55 bronze badges
add a comment |
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
You could wrap your whole script in
ob_start
andob_end_clean
. Save the value ofob_end_clean
and usestrlen
on it. Simplyecho
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