For debugging I want to echo or print my MySQL with html replacements for the nl and horizontal tabs.
$sql="
SELECT
*
FROM
`mytable`;";
I can do echo nl2br($sql);
in order to replace \\n
with <br />
. This gives me the screen output:
SELECT
*
FROM
`mytable`;
Now I want to swap the horizontal tabs for something like
in order to indent them on the screen.
What could I use instead of
, I've never liked it?
Thanks
您可以使用HTML <pre>
标记。
echo '<pre>' . $sql . '</pre>';
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.