Home  >  Article  >  Backend Development  >  PHP cannot output string with spaces

PHP cannot output string with spaces

藏色散人
藏色散人Original
2019-09-29 10:15:554014browse

PHP cannot output string with spaces

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn