File Manipulation
Posted: Thu Sep 09, 2010 8:07 am
Hello
I am new to the forum but not new to PHP. I used to do a hell fo a lot of programming but since startign a new job I havent done any.
Using Google Maps you can put a link into your URL which will calculate a a router and display the route using the URL.
Example:
http://maps.google.co.uk/maps?f=d&sourc ... &doflg=ptm
This will load the route and give directions.
Now if you put "&output=kml" on the end of the URL, this will initiate a file download of all the information, this file can be opened in Notepad. In part of this file it says "Distance" followed by a number in decimals. Which is the distance between the two destinations that are highlighed in the URL.
I need to get this distance into a variable using a web form. So the user puts in start and end postcodes into a form and hits submit. This will then insert the two postcodes into a URL, then I want the PHP code to download, open and find the Distance: 5.10 and put the "5.10" in the PHP code as a variable, so that I can then perform more calculations.
Am I correct in saying that PHP can do this using something along the lines of fopen command? Or would it be something completly different and advanced?
Thanks, any Help is much appriciated.
Simon
I am new to the forum but not new to PHP. I used to do a hell fo a lot of programming but since startign a new job I havent done any.
Using Google Maps you can put a link into your URL which will calculate a a router and display the route using the URL.
Example:
http://maps.google.co.uk/maps?f=d&sourc ... &doflg=ptm
This will load the route and give directions.
Now if you put "&output=kml" on the end of the URL, this will initiate a file download of all the information, this file can be opened in Notepad. In part of this file it says "Distance" followed by a number in decimals. Which is the distance between the two destinations that are highlighed in the URL.
I need to get this distance into a variable using a web form. So the user puts in start and end postcodes into a form and hits submit. This will then insert the two postcodes into a URL, then I want the PHP code to download, open and find the Distance: 5.10 and put the "5.10" in the PHP code as a variable, so that I can then perform more calculations.
Am I correct in saying that PHP can do this using something along the lines of fopen command? Or would it be something completly different and advanced?
Thanks, any Help is much appriciated.
Simon