I'm getting some random php whitespace that i can't get rid of, Im selecting the data from the table and then directly echoing it using: echo 'aaa'.$row[0].'aaa'; $page=str_replace(' ', '',$row[0]); echo 'aaa'.$page.'aaa'; PHP: Output: aaa ResultText aaa aaa ResultTextaaa Code (markup): I don't understand why all whitespace isn't being removed?
Try: echo 'aaa'. trim($row[0]) .'aaa'; PHP: Note that the browser interprets new lines as spaces as well. You can probably see them in the source code.