Re: html to plain text



Sam Tang said the following on 30/10/2005 08:09:
Disco Octopus wrote:

Hi,

I would like to know if there is a function in php that takes a string
which is HTML, and returns a string that is all the text in the source
string without the HTML tags.

so, for example....

given a source string of this.....

          <p>Hello <b>world</b>.</p>
          <p>Goodbye <b>world</b>.</p>

I would like to have returned...

          Hello world.
          Goodbye world.

I think htmlentities() is what you looking for:


I don't think so...





--
Oli
.



Relevant Pages

  • Re: getAttribute question
    ... oddity with IE that getAttributereturns an empty string if the ... HTML specification, ... appropriate places in the HTML 4 and DOM HTML specifications. ...
    (comp.lang.javascript)
  • Re: [PHP] generating an html intro text ...
    ... You would have to search out and pull in all closing tags. ... grab 256 characters -- The string. ... html markup should not go towards the string length count, ...
    (php.general)
  • [perl-python] 20050127 traverse a dir
    ... suppose you want to walk into a directory, say, to apply a string ... replacement to all html files. ... So, when ever myfun is called, we need to loop thru the ... # with a recursive "filter" ...
    (comp.lang.perl.misc)
  • [perl-python] 20050127 traverse a dir
    ... suppose you want to walk into a directory, say, to apply a string ... replacement to all html files. ... So, when ever myfun is called, we need to loop thru the ... # with a recursive "filter" ...
    (comp.lang.python)
  • Re: is there a way to take an html string and render it as a web browser would, from the command lin
    ... is there a way to take an html string and render it as a web ... browser would, from the command line? ... particular, image tags should print out as images, not image tags. ...
    (comp.lang.php)