Welcome to Geeklog, Anonymous Sunday, September 24 2023 @ 11:13 pm EDT

Geeklog Forums

A Little PHP Help

Status: offline


Forum User
Registered: 12/05/04
Posts: 28
I have noticed that everyone here seems to be very fluent in PHP. So here is my PHP problem (complete PHP noob here, watch out):

I would like to use this PHP script (for HTML to TEXT):


The notes of the code say:

"To use this library, put the following line in your script before the part that needs it:


I would be very happy if someone here could tell me how to enter the variable of the URL into this script. The way I would want to do it would be to have a webpage were you could enter a URL and have it converted.

Sam Krupa

Status: offline


Forum User
Registered: 12/05/04
Posts: 28
Okay, new problem.

This code:
Text Formatted Code


// Include the class definition file.

// The "source" HTML you want to convert, stored in a file.
$filename =

// Instantiate a new instance of the class. Passing the filename
// followed by the "true" flag tells the class to find the HTML
// in the specified file. Should work on remote files, too.
$h2t =& new html2text($filename, true);

// The HTML is likely full of relative links, so let's specify
// an absolute source.

// Simply call the get_text() method for the class to convert
// the HTML to the plain text. Store it into the variable.
$text = $h2t->get_text();

// Or, alternatively, you can print it out directly:



I specify "filename" this way:


This only lets me specify local files. How do I specify URLs?
Sam Krupa

Status: offline


Forum User
Full Member
Registered: 05/26/03
Posts: 329
ignore this post. Doh! - that was a mistake
GeekLog Hosting, Installations and Upgrades - WWW.AWEHOST.COM - Hosting starts @ only $4.95/mo.

All times are EDT. The time is now 11:13 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content