Possible to determine content-length from output text?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jhorra
Forum Newbie
Posts: 24
Joined: Mon Aug 18, 2003 1:00 am

Possible to determine content-length from output text?

Post by Jhorra »

I have a file that outputs a session value. I need to set the content-length header, but I'm not sure how to determine content-length based solely on the output of that text. Is this possible?
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Possible to determine content-length from output text?

Post by alex.barylski »

strlen???
Jhorra
Forum Newbie
Posts: 24
Joined: Mon Aug 18, 2003 1:00 am

Re: Possible to determine content-length from output text?

Post by Jhorra »

I tried strlen, and it output something like 50000, but when I save that text to a text file and save it to my desktop it says it's 16kb. Is that correct?
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Possible to determine content-length from output text?

Post by alex.barylski »

That doesn't sound right, no. Are you working with multibyte languages?
Post Reply