\n"; echo "\n"; echo "\n"; //This script takes input from an online editgrid spreadsheet and creates KML. $string2 = 1; $placename3 = "http://www.editgrid.com/user/glennon/testspread/Sheet1!A$string2"; $anythinginthere = file($placename3); while ($anythinginthere[0]) { $string2 = $string2 + 1; $placename3 = "http://www.editgrid.com/user/glennon/testspread/Sheet1!A$string2"; $location4 = "http://www.editgrid.com/user/glennon/testspread/Sheet1!B$string2"; $description5 = "http://www.editgrid.com/user/glennon/testspread/Sheet1!C$string2"; $latlong6 = "http://www.editgrid.com/user/glennon/testspread/Sheet1!D$string2"; $anythinginthere = file($placename3); // use this if statement to account for the last line which yields a true // even after its empty. the next line yields a false, so it won' execute these // next parts. if ($anythinginthere[0]) { $addressarray = file($location4); $descriparray = file($description5); $latlongarray = file($latlong6); // echo "$anythinginthere[0] $addressarray[0] $descriparray[0] $latlongarray[0]"; // write a static KML file echo "\n"; echo "$anythinginthere[0]\n"; echo "$descriparray[0]\n"; echo "\n"; echo "$latlongarray[0]\n"; echo "\n"; echo "\n"; } } // Total number of data entries (Placemarks) is $string2 - 2 // This substracts the header and the last cell before the null. $datapointcount = ($string2 - 2); // A few KML administrative tags echo ""; echo ""; ?>