How to output spaces in PHP, answer:
A space is a string, use quotation marks before and after (but both are acceptable), and then use echo to output, for example, as follows The statement outputs two spaces:
echo ' ';
PHP cannot output the string with spaces. Answer:
This is because you are outputting the web page on the browser. Generally speaking, The web page will filter out extra spaces. There are two solutions. One is to use Chinese full-width spaces, and the other is to use standard special symbols . The following two statements are examples:
echo " "echo " ";
For more PHP related knowledge, please visit PHP Tutorial!
The above is the detailed content of PHP cannot output string with spaces. For more information, please follow other related articles on the PHP Chinese website!