In a simple example of geocoding with Yahoo placefinder, I am getting a return but my understandinig is the return is supposed to be xml. I am just getting a plain string. Am I supposed to be setting something else? I am under the impression their return default is xml. While I can certainly parse the string to find lat/long, anything else would be difficult I think.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "where.yahooapis.com/geocode?location=15+marrett+rd,+lexington,+ma&appid=xxxx");
curl_setopt($ch, CURLOPT_VERBOSE, 1);
$output = curl_exec($ch);
Any ideas how to get this in an xml format?
Never mind, it's "text/plain", correct?
Don't output the
$output as HTML else you won't see it properly! Before you output anything write the line
ini_set('default_mimetype', 'text/plain'); (you also won't need the
Many thanks. That works great.
Salathe has already pointed it out.
Stupid question, set it to "text" or "plain text"?
For what it's worth, you can also set that INI option within your php.ini file (on the server/computer that you develop your code on) to output, by default, as plain text. The default of HTML (
text/html) can be exceptionally annoying and is the cause of lots of questions like yours here.