ted_chou12 Posted December 25, 2006 Share Posted December 25, 2006 hey, i got it ;D suddenly remembered... explode explodes everything... ;)[code]<?php$position = "N18 23.5725 W66 23.8565";$ex1 = explode(" ",$position); $number1 = ($ex1[1]/60);if (substr($ex1[0], 0, 1) == "N"){$answer1 = $number1 + substr($ex1[0], 1, 3);}if (substr($ex1[0], 0, 1) == "W"){$answer1 = 0 - ($number1 + substr($ex1[0], 1, 3));} $number2 = ($ex1[3]/60);if (substr($ex1[2], 0, 1) == "N"){$answer2 = $number2 + substr($ex1[2], 1, 3);}if (substr($ex1[2], 0, 1) == "W"){$answer2 = 0 - ($number2 + substr($ex1[2], 1, 3));}echo "$answer1 and $answer2";?>[/code] Quote Link to comment Share on other sites More sharing options...
ERuiz Posted December 25, 2006 Author Share Posted December 25, 2006 WOOOHOOOO!!!!! YOU GOT IT!!!! THANKS A MILLION! ;D ;D ;D ;DShould I even ask for one last thing? hahahahaha I need for each result to be trimmed down to only 4 decimal places. ;) Quote Link to comment Share on other sites More sharing options...
ted_chou12 Posted December 25, 2006 Share Posted December 25, 2006 thats easy :D hold on Quote Link to comment Share on other sites More sharing options...
ted_chou12 Posted December 25, 2006 Share Posted December 25, 2006 [code]<?php$position = "N18 23.5725 W66 23.8565";$ex1 = explode(" ",$position); $number1 = ($ex1[1]/60);if (substr($ex1[0], 0, 1) == "N"){$answer1 = $number1 + substr($ex1[0], 1, 3);}if (substr($ex1[0], 0, 1) == "W"){$answer1 = 0 - ($number1 + substr($ex1[0], 1, 3));} $number2 = ($ex1[3]/60);if (substr($ex1[2], 0, 1) == "N"){$answer2 = $number2 + substr($ex1[2], 1, 3);}if (substr($ex1[2], 0, 1) == "W"){$answer2 = 0 - ($number2 + substr($ex1[2], 1, 3));}$dp1 = round($answer1,4);$dp2 = round($answer2,4);echo "$dp1 and $dp2";?>[/code]sorry, you cant have numbers before letters for variable mybad. Quote Link to comment Share on other sites More sharing options...
ERuiz Posted December 25, 2006 Author Share Posted December 25, 2006 SIMPLY AMAZING!!!! What an experience this has been, buddy! I am grateful for all your help. Kudos to you!Regards,Efrain Ruiz Quote Link to comment Share on other sites More sharing options...
ted_chou12 Posted December 25, 2006 Share Posted December 25, 2006 welcome, ive also had a good time figuring out.. i enjoy math problems even mroe doing them on computers.. :D Quote Link to comment Share on other sites More sharing options...
ERuiz Posted December 25, 2006 Author Share Posted December 25, 2006 I hate math! hahahaha Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.