Hello:
I'm hoping someone can give me some insight as to why this is happening. Whenever I do an echo in my code and read it from a client side program it ALWAYS prepends the echo with a zero (0).
I'm using PHP version 4.4.4.
Thanks for your help with this.
Chris
PHP Echo Prepending with a Zero?
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: PHP Echo Prepending with a Zero?
That is very odd... example? Code?
Re: PHP Echo Prepending with a Zero?
Sounds like it would have to be a character encoding issue. What hardware is this running on?chodges wrote:Hello:
I'm hoping someone can give me some insight as to why this is happening. Whenever I do an echo in my code and read it from a client side program it ALWAYS prepends the echo with a zero (0).
I'm using PHP version 4.4.4.
Thanks for your help with this.
Chris
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: PHP Echo Prepending with a Zero?
No, it sounds like you're echoing the return value of a function which outputs something:
EDIT | Meh, I'm wrong, the 0 would follow in my case.
Code: Select all
function foo() {
echo "test";
return 0;
}
echo foo(); //0testRe: PHP Echo Prepending with a Zero?
Thanks for your feedback but the problem is that it is PREPENDING with a zero meaning that if I do something like this:
echo "-1001|";
what I get back is: "0-1001|0"
Can't figure this out for the life of me.
Chris
echo "-1001|";
what I get back is: "0-1001|0"
Can't figure this out for the life of me.
Chris
Re: PHP Echo Prepending with a Zero?
Oh also this is running on Linux Intel Hardware Kernel 2.6.17.11-grsechg
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: PHP Echo Prepending with a Zero?
If you echo two things on the same page, do both echo's have a zero, or just the first? I'm thinking it could be your editor with a UTF-8 character set sending a dodgy BOM.