<?php 
	$pathforfile='keyword.csv';
	if (($handle = fopen($pathforfile, "r")) !== FALSE) {
		$i = 1;
		$links = "";
		while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
			
			$num = count($data);
			$areaname = $data[0];
			$street_add = $data[1];
			$postalcode = $data[2];
			$postcode = explode(' ', $postalcode);
			$cordi_lat = $data[3];
			$cordi_long = $data[4];
			$wiki_url = $data[5];
			$keyword = $data[6];
			$pageurl = $data[7];
			
			$links .="<div class='col-sm-3'>";
			$links .= "<a href='".$pageurl."' target='_blank' style='color: #000; padding: 0px; font-weight: 500; font-size: 18px; text-decoration: none; line-height: 2;'>".$areaname."</a>";
			$links .="</div>";
			$i++;
			
		}
		echo "<!DOCTYPE html>
				<html lang='en'>
					<head>
						<title>Explore a World of Knowledge: Diverse Topics at Your Fingertips</title>
						<meta charset='utf-8'>
						<meta name='viewport' content='width=device-width, initial-scale=1'>
						<link href='https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css' rel='stylesheet'>						
						<script src='https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js'></script>
					</head>
					<body style='background-color: rgba(255, 255, 255, 1); color: #FFFFFF;'>		
						<div class='container'>
							<div class='row'>								
								$links								
							</div>
						</div>		
					</body>
				</html>";			
	}	
?>

