How to get pretty HTML source code from PHP generated output?

前端 未结 2 1972
说谎
说谎 2021-01-23 01:54

When you look at the source code of PHP generated output usually everything is on one line, it makes it very hard for front end developers to read the code and trouble shoot.

2条回答
  •  被撕碎了的回忆
    2021-01-23 02:36

    For more or less clean looking PHP generated code I used " signs for the echo output Strings, wich enables you to use \n and \t or other codes like that to make new Lines or Code indentation. If you need " signs in your output you need to escape them with \". this will output a " but PHP will treat it like a usual character.

    I know it is a pain getting a beautiful code this way but at least it makes it readable.

提交回复
热议问题