Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert HTML code into Text 1

Status
Not open for further replies.

s0crates9

Technical User
Jun 18, 2005
70
US
I have used file($url) as a way to grab a webpage and I am interested in knowing how to turn that code into true HTML code in text format instead of activated HTML. For instance I might pull off a link form a website and it will show up when displayed from a variable like so:

Code:
[COLOR=blue]Active link[/color]

instead of:
Code:
<a href="[URL unfurl="true"]http://www.site.com">Non[/URL] Active Link</a>

I essentially want the HTML as it would appear in notepad not a web browser or word file.

Thanks for your help in advance!

Web site design, internet marketing, SEO and business solutions company.
 
Try running the content of the website contents through [blue]htmlentities()[/blue].

PHP Manual entry for htmlentities:
Then you can Just echo it, and it should look normal, but will not get parsed by the browser.






----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Glad it worked for you ,You are welcome.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top