PHP cannot output string with spaces

藏色散人
Release: 2023-02-25 14:28:01
Original
4181 people have browsed it

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 '  ';
Copy after login

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 "   ";
Copy after login

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!

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!