link7722 Posted October 15, 2012 Share Posted October 15, 2012 Hello I want to display the contents of a file in html like this: <?php $file = file.txt; echo '<code><pre>' . $file . '</pre></code>' ; ?> The problem is that because the file contains sentences which have "<" and ">" characters, for example "Bla bla <6545465465> bla bla " the content <6545465465> is not displayed on the page. Is there a way to display what is inside these speccial characters ? Thank you Link to comment https://forums.phpfreaks.com/topic/269474-display/ Share on other sites More sharing options...
gizmola Posted October 15, 2012 Share Posted October 15, 2012 Take a look at htmlentities. Link to comment https://forums.phpfreaks.com/topic/269474-display/#findComment-1385252 Share on other sites More sharing options...
link7722 Posted October 15, 2012 Author Share Posted October 15, 2012 Take a look at htmlentities. htmlentities. did the jobThank you Link to comment https://forums.phpfreaks.com/topic/269474-display/#findComment-1385253 Share on other sites More sharing options...
Volter9 Posted November 7, 2012 Share Posted November 7, 2012 link7722, you can also use htmlspecialchars() Link to comment https://forums.phpfreaks.com/topic/269474-display/#findComment-1390695 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.