<?php
$lines = file('sample.html');
$str = implode("\n", $lines);
include('ArIdentifier.class.php');
$obj = new ArIdentifier();
$pos = $obj->identify($str);
$total = count($pos);
echo substr($str, 0, $pos[0]);
for($i=0; $i<$total; $i+=2){
echo '<span style="BACKGROUND-COLOR: #EEEE80">';
echo substr($str, $pos[$i], $pos[$i+1]-$pos[$i]);
echo '</span>';
echo substr($str, $pos[$i+1], $pos[$i+2]-$pos[$i+1]);
}
?>
|