I want to try the new Yahoo API, but I get the PHP5 error message
Unknown encoding "utf-8"
in the marked line below...
(After that, applying the Xpath will fail as symptom of the first bug.)
function showImages($q)
{
$image_url = 'http://api.search.yaho o.com/' .
'ImageSearchSer vice/V1/imageSearch?' .
'appid=YahooDem o&query=' . urlencode($q) . '&results=5';
$dom = new domdocument; // ERROR!
$dom->load($image_ur l);
$xpath = new domxpath($dom);
$xNodes = $xpath->query('//Result');
foreach ($xNodes as $xNode)
{
// ...
}
}
Can anyone help? I tried some encoding workarounds but nothing
worked... note my direct file access with PHP5 is disabled on my server
(using file() or fopen()).
--
Google Blogoscoped
Unknown encoding "utf-8"
in the marked line below...
(After that, applying the Xpath will fail as symptom of the first bug.)
function showImages($q)
{
$image_url = 'http://api.search.yaho o.com/' .
'ImageSearchSer vice/V1/imageSearch?' .
'appid=YahooDem o&query=' . urlencode($q) . '&results=5';
$dom = new domdocument; // ERROR!
$dom->load($image_ur l);
$xpath = new domxpath($dom);
$xNodes = $xpath->query('//Result');
foreach ($xNodes as $xNode)
{
// ...
}
}
Can anyone help? I tried some encoding workarounds but nothing
worked... note my direct file access with PHP5 is disabled on my server
(using file() or fopen()).
--
Google Blogoscoped
Comment