php - echo a string, replacing nl with br and horizontal tabs with some html char -


for debugging want echo or print mysql html replacements nl , horizontal tabs.

$sql=" select     *     `mytable`;"; 

i can echo nl2br($sql); in order replace \n <br />. gives me screen output:

select * `mytable`; 

now want swap horizontal tabs &nbsp; in order indent them on screen.

what use instead of &nbsp;, i've never liked it?

thanks

you use html <pre> tag.

echo '<pre>' . $sql . '</pre>'; 

Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -