title: PHP Distance between two points latitude longitude
body: <p>I am after a very simple distance between two 2D points function for PHP.</p>
  
  <p>For example <code>lat</code>, <code>lng</code> of <code>-50000.00,400.00</code>. This is a flat surface, no need calculate for the earth circumference.</p>
  
  <p>I have tried all sorts of solutions for this and none of them work correctly. I do not know why but when <code>lat</code> or <code>lng</code> is > <code>~240.00</code> the result starts going backwards as if the distance is too great to calculate. Even the online calculators fail to calculate a large distance.</p>
  
  <p>Any help would be greatly appreciated.</p>