Location: PHPKode > scripts > HTML to Array > html-to-array/example.php
<?php
	include_once('shweta_dom.php');
	$prodDetailArray = array();
	$i = 0;
	$j = 0;
	$countOverview = 0;
	$countCompany = 0;
	$countComOther = 0;
	$countOther = 0;

	$html = file_get_html('http://www.npros.com/dir/4life');
	foreach($html->find('.Box') as $saprateBlock){
		foreach($saprateBlock->find('div.whitebold') as $getCompany){
			if($countCompany == 0){
				$prodDetailArray['percent'] =  preg_replace('/\s\s+/', ' ', strip_tags($getCompany->innertext)) ;
				$countCompany++;
			}
		}
	}
	
	echo "<pre>";
		print_R($prodDetailArray);
	echo "</pre>";

?>	
Return current item: HTML to Array