<?
 
/*
 
Author: Alexey G. Piyanin (e-mail: drdrzlo at mail dot ru)
 
Date:   Feb 15 2005
 
Title:  Show only images use class
 
*/
 
include('SAXParser.php');
 
 
function begin($tag,$attributes,$readSize){
 
  global $cnt;
 
  if ($tag=='img' && isset($attributes['src']))
 
    echo ++$cnt.': <img src="'.$attributes['src'].'" border="0" '.(isset($attributes['width'])?'width="'.$attributes['width'].'"':'').' '.(isset($attributes['height'])?'height="'.$attributes['height'].'"':'').' /><br>'."\n";
 
}
 
 
$cnt = 0;
 
$parser = new HTML_SAXParser();
 
$parser->initFunc('begin');?>
 
<html>
 
<body>
 
<center>Source page:<br><iframe src="example1.html" width="600" height="400" ></iframe><br><br>
 
Images:<br>
 
<?$parser->parse('example1.html');?>
 
</center>
 
</body></html>
 
 |