Send XML content from PHP with POST

This PHP snippet allows you to send an XML string to a SOAP endpoint. This isn’t the only way but it’s the one I prefer. $xml = ‘….your_xml_string….’; $send_context = stream_context_create(array( ‘http’ => array( ‘method’ => ‘POST’, ‘header’ => ‘Content-Type: application/xml’, ‘content’ => $xml )...

Calculate distance between 2 geopoints

Calculating distance between GPS coordinates is something you’ll ALWAYS have to do on any geolocation-enabled application. The most common use-case is to calculate the distance between the user’s current location and any other reference. The TypeScript function ‘calculateDistance’ returns the distance in kilometers: const calculateDistance...