Remove extra whitespace after displaying something through php
i have a difficult problem i think.

I print a random text from my database(mysql) through echo and near the text i print, there is a button.I want the button to be floated permanently on the right side.So between the text and the button there is an extra white space whose length is changing as i said i print random text.I know the replace function in javascript and especially this:

string.replace(/ /g,"_");

The problem is that this whitespace isn't printed but it's just the whitespace of the page.Any help?
Remove extra whitespace after displaying something through php
===

i have a difficult problem i think.

I print a random text from my database(mysql) through echo and near the text i print, there is a button.I want the button to be floated permanently on the right side.So between the text and the button there is an extra white space whose length is changing as i said i print random text.I know the replace function in javascript and especially this:

string.replace(/ /g,"_");

The problem is that this whitespace isn't printed but it's just the whitespace of the page.Any help?