Jump to content

[SOLVED] php render html as text problem


SN1P3R_85

Recommended Posts

I am having a problem with a php script. I want it take the text, and convert all the html tags into literal text. By this i mean if i have a string:

 

<?php
$str = "hello<br /><br />hello"
?>

 

I want it to print to the screen as hello<br /><br />hello. My script automatically prints it as an html entity, so it will actually do a line break in the string container. However, my script detects line breaks in the php and puts <br /> in, so I need to somehow take the string, convert it to straight text, then be able to still add html, and have it display as html.

 

Thanks, SN1P3R_85

Link to comment
https://forums.phpfreaks.com/topic/150631-solved-php-render-html-as-text-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.