WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Calculate the great circle distance between two latitude/longitudes
Categories : Algorithms, PHP Update Picture
David Sklar
Date : Jan 16th 1999
Grade : 1 of 5 (graded 5 times)
Viewed : 18797
File : No file for this code example.
Images : No Images for this code example.
Search : More code by David Sklar
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<?php

/* assume your points, in decimal, are in $lon1,$lat1 and $lon2,$lat2
* this can also be useful with the US ZIPcodes at
* http://ftp.census.gov/geo/www/gazetteer/places.html
*/

$pi = 3.1415926;
$rad = doubleval($pi/180.0);


$lon1 = doubleval($lon1)*$rad; $lat1 = doubleval($lat1)*$rad;
$lon2 = doubleval($lon2)*$rad; $lat2 = doubleval($lat2)*$rad;

$theta = $lon2 - $lon1;
$dist = acos(sin($lat1) * sin($lat2) + cos($lat1) * cos($lat2) * cos
($theta));
if ($dist < 0) { $dist += $pi; }
$dist = $dist * 6371.2;
$miles = doubleval($dist * 0.621);
$inches = doubleval($miles*63360);
$dist = sprintf( "%.2f",$dist);
$miles = sprintf( "%.2f",$miles);
$inches = sprintf( "%.2f",$inches);

?>



Test code for authticket.phl
Categories : Algorithms, PHP
A very simple way to build and do a hierarchical html categories browser without javascript , just using html php and mySql
Categories : HTML and PHP, Databases, Algorithms, PHP, MySQL
Query2Report : Generating Html, Pdf and Csv Reports from SQL Query
Categories : PHP, PHP, HTML, PDF, Excel
SHA: Implementation of the Secure Hash Algorithm in pure PHP. This is a secure one-way function that can be used to perform challenge response login algorithms over an insecure connection.
Categories : Algorithms, PHP, Security
Calculate Body Mass Index
Categories : PHP, Algorithms, Regexps
A class to put get and post variables in hidden form elements. Works on scalars, normal arrays, associative arrays.
Categories : Algorithms, Variables, Arrays, PHP, PHP Classes
A very simple and efficient split bar the B-Z bar , for mysql and php ... Tired of obfuscated code try this one ...
Categories : PHP, Databases, MySQL, Algorithms
PHP Function to Encrypt/Decrypt a string without a known key. The string itself has his own different key for every character.
Categories : PHP, Algorithms, Security, Authentication, Encryption
Paginating the mySQL data
Categories : PHP, Algorithms, Databases, MySQL, HTML and PHP
Find the day of the week for any given year/month/day.
Categories : PHP, Date Time, Data Validation, Algorithms, Beginner Guides
Timer - a class that uses microtime() to provide easy calculation of elapsed times
Categories : Algorithms, PHP, PHP Classes
Show the steps for converting a number from a given base to base 10. Shows the steps involved in converting a number from a given base to base 10.
Categories : PHP, Math., Algorithms
How to judge if an integer is odd or is even in Php3?
Categories : Math., PHP, Algorithms
minus - subtract arrays. Send two arrays and get an array with the operation A-B, elements on A that are not included on B.
Categories : PHP, Arrays, Algorithms
IPhider Obscure Any URL Anonymity connection lores obfuscation corporate survival.
Categories : PHP, Algorithms, Security, URLs
 Frederic Hecq wrote :15
Great code !
But what about metric system?
What are the values?