Page 1 of 1

Help with a PHP script

Posted: Mon Sep 16, 2013 4:24 pm
by jenko
Hello all, I am a beginner at scripting but need this done for a personal project.

My aim is to make a website, with two input boxes, users will then enter two co-ordinates: "571837.62N" AND "0021601.95W"

Then the website will convert the two inputed coordinates to the following output format "N057.18.37.620 W002.16.01.950".

Can anyone provide me with a code for this?

Many thanks in advanced. :)

Re: Help with a PHP script

Posted: Mon Sep 16, 2013 5:47 pm
by requinix
If your users have to type the numbers in anyways, can't you just make them type it in the slightly different format that you want? Seriously, it's just a couple added periods with the letter moved.

Re: Help with a PHP script

Posted: Tue Sep 17, 2013 12:13 pm
by Christopher
Use the substr() function to check and extract substrings in the input strings. Concatenate the parts back together.