php echo of html tag as text

2

I have a query in php / oracle that hides a "" tag while displaying the result in the browser while in oracle sql developer displays everything ok.

Expected: '

asked by anonymous 25.11.2015 / 15:09

1 answer

1

To print php or html code as plain text you can use the highlight_string function.

<?php
$str = '<p><b>texto</b></p>';
highlight_string($str);

The output of highlight_string() is almost the same as htmlspecialchars () , except for <code> and <span> .

<?php
$str = htmlspecialchars('<p><b>texto</b></p>');
echo $str;
    
25.11.2015 / 15:36