Page 1 of 1
PHP Echo Prepending with a Zero?
Posted: Sat Feb 02, 2008 11:51 am
by chodges
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
Re: PHP Echo Prepending with a Zero?
Posted: Sat Feb 02, 2008 11:55 am
by John Cartwright
That is very odd... example? Code?
Re: PHP Echo Prepending with a Zero?
Posted: Sat Feb 02, 2008 6:33 pm
by califdon
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
Sounds like it would have to be a character encoding issue. What hardware is this running on?
Re: PHP Echo Prepending with a Zero?
Posted: Sat Feb 02, 2008 7:10 pm
by Chris Corbyn
No, it sounds like you're echoing the return value of a function which outputs something:
Code: Select all
function foo() {
echo "test";
return 0;
}
echo foo(); //0test
EDIT | Meh, I'm wrong, the 0 would follow in my case.
Re: PHP Echo Prepending with a Zero?
Posted: Sat Feb 02, 2008 8:18 pm
by chodges
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
Re: PHP Echo Prepending with a Zero?
Posted: Sat Feb 02, 2008 8:19 pm
by chodges
Oh also this is running on Linux Intel Hardware Kernel 2.6.17.11-grsechg
Re: PHP Echo Prepending with a Zero?
Posted: Sun Feb 03, 2008 1:33 am
by Chris Corbyn
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.