<?php
$nominatimUrl 
'http://nominatim.openstreetmap.org/search?format=json&limit=1&q=';
$from urlencode"The London Eye, London" );
$to   urlencode"St Paul's Cathedral, City of London" );
$fromLL json_decodefile_get_contents"{$nominatimUrl}{$from}) );
$toLL   json_decodefile_get_contents"{$nominatimUrl}{$to}) );

$osrmUrl 'http://router.project-osrm.org/viaroute?instructions=true';
$osrmUrl .= sprintf"&loc=%.4f,%.4f"$fromLL[0]->lat$fromLL[0]->lon );
$osrmUrl .= sprintf"&loc=%.4f,%.4f"$toLL[0]->lat$toLL[0]->lon );

$headers =
    
"User-Agent: Derick Rethans/Presentation/20131113 osm@derickrethans.nl\r\n" .
    
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n" .
    
"Accept-Encoding: gzip\r\n";
$opts = array( 'http' => array( 'header' => $headers ) );

$context stream_context_create($opts);

var_dumpjson_decodegzdecodefile_get_contents$osrmUrlfalse$context ) ) ) );
?>
Output
NULL