Login   Register  
PHP Classes
elePHPant
Icontem

File: test.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of George Imerlishvili  >  HTML DOM parser  >  test.php  >  Download  
File: test.php
Role: Example script
Content type: text/plain
Description: how to use, description...
Class: HTML DOM parser
Extract data from HTML using regular expressions
Author: By
Last change:
Date: 2011-12-15 06:00
Size: 819 bytes
 

Contents

Class file image Download
<!DOCTYPE HTML>
<html lang="en"> 
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
    <title>Test</title>
    </head>
    <body>

<?php
include_once "Domparser.class.php";

$obj=new Domparser("http://sizeofint.com");

echo 
"Page title:";
echo 
'<pre>'.$obj->getTitle().'</pre>';

echo 
"All Images:";
echo 
'<pre>'.print_r($obj->getImages(),true).'</pre>';

echo 
"All links:";
echo 
'<pre>'.print_r($obj->getLinks(),true).'</pre>';

echo 
"Internal links:";

echo 
'<pre>'.print_r($obj->getInternalinks(),true).'</pre>';

echo 
"Extrenal links:";

echo 
'<pre>'.print_r($obj->getExternalinks(),true).'</pre>';

echo 
"Get div tag by id header:<br/>";
echo 
"<pre>";
echo 
htmlspecialchars($obj->getElementbyid("header"));
echo 
"</pre>";
?>



</body>
</html>