echo trims multiple white spaces in the middle of string
echo, html, php, string, whitespace
Solution
The normal white-space behavior is to collapse everything to one space. You can modify it by changing the `white-space:` css rule to `white-space: pre;` or `white-space: pre-wrap;`
See https://developer.mozilla.org/en/CSS/white-space for more details
Problem
The following code outputs a b: ``` $var="a b"; // I inserted 3 white spaces, and HTML is rendering only one echo $var; ``` The issue is that if I store $var in a table, it will KEEP the white spaces, and while reading, it strips them back. The striped data gets as it is updated in another table, resulting in mismatch of same values in both the tables. I tried google search and found in a thread that its how HTML behaves. Any hope on how can I fix this?