Find the biggest text on the page.

After googling for a while i found some methods using PHP's Document Object Model (DOM)
but none of them  works correctly.

In my opinion , the best and most reliable way to determine the biggest text on the web page is :
$TEXT1=array();
$TEXT=html_entity_decode(strip_tags($NewsHTML));
$TEXT=explode("\n",$TEXT);
foreach ($TEXT as $k=>$v){ unset($TEXT[$k]);$TEXT1[strlen($v)]=trim($v); }
$TEXT=$TEXT1;

ksort($TEXT);
$TEXT=(end($TEXT));

Comments

Popular posts from this blog

Using Debian on linksys NAS-200

Малко за мъката по светът.