<?php
set_time_limit(0);

// Create city list	
	$file_handle = fopen('areas.csv', 'r');

	while(!feof($file_handle)) 
	{
		$line 		= fgetcsv($file_handle, 1024);
		$city 		= $line[0];
		
		$cities[] = '"'.$city.'"';
	}
	fclose($file_handle);
	
	$content = implode(', ', $cities);
	chdir('/home/fdesign1/public_html/phone-numbers-uk.com/numbers/');
	$city_file = 'citylist.txt';
	$fh = fopen($city_file,'w');
	if(fwrite($fh,$content))
	{
		echo $city_file.' file created.<br>';
	}
	fclose($fh);
	
	echo '<br><b>City list has been created.</b>';
?>