Whitespace in browser, but without not in source

Hey guys,

I have a small problem that seems impossible to find the answer to, here it is:

When php returns the value it needs to return, there should be no white spaces between the values, ex:

value1,value2,value3

When i run echo $result; there are no white spaces and it’s all good. But when I try it form the browser it adds a white space. When I take a look at the source, there’s no white space there, values are in order as they should.

Can’t find anythin on how to get rid of the white spaces and why they even appear. Gotta be some default setting, but cant find it.

oh and forgot to add: it’s a for loop and an array

really? no one?

Perhaps copy the code here, and an example of the output? This may help get answers.

sorry just noticed this post I was busy on another issue here ya go:
echo$result;

Yes I tried that but webbrowser seems to put whitespaces. If I open up source of the page, no white spaces there. Any other idea?

As crossroads was saying,
It’s so hard to help you without seeing your code. It could be anything, anywhere in your code doing it.

Give us more information

Yep we won’t sit here an guess what your error is, we would need to see the code so we can figure out what is wrong

okay guys, sorry i wasnt clear enough but i was working on some code for a client and it would be very inappropriate for me to paste portions of the code here.

Anyways, for some reason in iteration in an array ( for loop) nested with an if, one case it was adding a white space. I used rtrim on the iteration so now it’s all good. Thanks for the help everyone and sorry for the inconvinience

Sponsor our Newsletter | Privacy Policy | Terms of Service