mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 03:01:43 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.3.2@11024 201d5d3c-b55e-5fd7-737f-ddc643e51545 |
||
|---|---|---|
| .. | ||
| CVS | ||
| src | ||
| LICENSE | ||
| README | ||
| release.sh | ||
HTML Parser for PHP 4
---------------------
This is a simple PHP based HTML parser.
How to Use
----------
Simply copy src/htmlparser.inc to a location in your
codebase where you'd like to be able to include it.
The PHP file which uses the parser might look like
this:
<?
include ("htmlparser.inc");
$htmlText = "... HTML text here ...";
HtmlParser parser = new HtmlParser ($htmlText);
while ($parser->parse()) {
// Data you can use here:
//
// $parser->iNodeType
// $parser->iNodeName
// $parser->iNodeValue
// $parser->iNodeAttributes
}
You will find additional documentation for each
field in the source code.
?>
Files of Interest
-----------------
src/htmlparser.inc -- Has HtmlParser class
src/html2text.inc -- Has Html2Text class
src/ex_dumptags.php -- Example: Dumps HTML nodes from test HTML string
src/ex_html2text.php -- Example: Dumps text for test HTML string
Running examples offline
------------------------
On a Unix system, you can run the examples as follows
if you have PHP installed:
cd src
php < ex_dumptags.php
php < ex_html2text.php
License
-------
This is an open source project. The license is
based on the Apache Software License. See the file
named LICENSE.
Author
------
The parser and the HTML-to-text example were written
by Jose Solorzano of Starnetsys, LLC. If you need a
program or website developed, professionally, within
budget, and on time, contact us (http://starnetsys.com)