I would like it to look readable when displaying echo html source, for which I thought to use the characters \ n and \ s. For example, I expected that echo "test \ ntest" would output in the view-source: test test But as a result I see test \ ntest. Hence the question of how to make a conclusion using echo, so that when viewing the source code, the \ n symbol is not output, but processed by the source code viewer as a line break?

  • view source: does not display its own hyphenation symbols, this is exactly the effect I need - Vladimir
  • one
    Can a screen of surses? And what file encoding? - Alexey Shimansky
  • 2
    Okay. In general, you have a string most likely in single quotes. Use double ... or PHP_EOL ...... i.e. in general should be either echo "<ul>test\n</ul>"; or echo '<ul>test'.PHP_EOL.'</ul>'; - Alexey Shimansky
  • one
    Hmm ... yes, it seems like just a space should be poked and that's all. Four spaces in the sources will be like a big space - Alexey Shimansky
  • one
    On the offside in simple language about quotes told, you can take a look: PHP strings . - Roman Grinyov

1 answer 1

Need to use HTML tag - <br>

  • Do you mean </ br>? - Vladimir
  • I'm interested in the translation in sorts, and not the code interpreted by the browser - Vladimir
  • Try to write more detailed answers. Explain what is the basis of your statement? - Nicolas Chabanovsky