Thank you for your help.
We are installing PHP-created pages on the website.
I got the response header for that page, but I'm a little troubled because it doesn't seem to print Content-Length.
Is it possible to solve this problem by setting up PHP?
I would appreciate it if you could give me some advice.
Thank you for your cooperation.
(Please forgive me for using the wrong Japanese. I use Google translation to answer this question.)
The best way to calculate the Content-Length response is to use the PHP output buffer. Give me an example:
<?php
ob_start();// Start capturing your output
echo('Useful Output'."\n"); // Add some outputs
header('Content-Length:'.ob_get_length()) ;/ Set HTTP header
ob_end_flush();// Display your output
This is also useful for creating files and images.
I hope this will help you!
© 2023 OneMinuteCode. All rights reserved.