It looks like the calculation you're referencing uses a spherical coordinate system. The formula is almost correct. Part of what could be throwing your calculation off is the radius you're using. The 69.09 is the radius of the sphere (earth in this case). As you may know, the earth isn't really a sphere, more of an ellipsoid. I'd suggest trying the formulation below:
3963 * acos(sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($lon1 - $lon2)));
For more accurate results, you'll want to use Vincenty or Haversine calculations.
EDIT: To clarify, I'm not trying to imply that the bulk of the error you're reporting is due to using a spherical coordinate calculation. That error is much smaller than what you're seeing. The formula adjustment I supplied was intended to be a clearer version of the formula, as the 69.09 was a value of the radius of the earth adjusted to a degree system, which is less intuitive than simply using radians. Additionally, it's worth noting that for calculating very small distances, using the formula above is highly accurate (down to about 1m distances) as long as the system doing the calculation is working with enough decimal places. Using a float in modern computing gives you this accuracy.