Hi have been playing with a php script from the Yahoo API developers site.
I need help extracting information from this multidimensional arrary but havnt had any luck . All the examples and documents I've read about arrays havnt been to helpful with this problem.
The Yahoo code that creates the array
<?php
// Parsing Yahoo! REST Web Service results using
// unserialize. PHP4/PHP5
// Author: Jason Levitt
// February 1, 2006
error_reporting(E_ALL);
// output=php means that the request will return serialized PHP
$request = 'http://api.search.yahoo.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&query=NFL-News&results=4&output=php';
$response = file_get_contents($request);
if ($response === false) {
die('Request failed');
}
$phpobj = unserialize($response);
echo '<pre>';
print_r ($phpobj);
echo '</pre>';
?>
and it outputs this
Array
(
[ResultSet] => Array
(
[totalResultsAvailable] => 41336
[totalResultsReturned] => 4
[firstResultPosition] => 1
[Result] => Array
(
[0] => Array
(
[Title] => 51_NFL-News.JPG
[Summary] =>
[Url] => http://media.scout.com/Media/NFL/51_NFL-News.JPG
[ClickUrl] => http://media.scout.com/Media/NFL/51_NFL-News.JPG
[RefererUrl] => http://story.scout.com/a.z?s=67&p=2&c=260347
[FileSize] => 9317
[FileFormat] => jpeg
[Height] => 120
[Width] => 160
[Thumbnail] => Array
(
[Url] => http://re3.mm-a1.yimg.com/image/69932283
[Height] => 93
[Width] => 125
)
)
[1] => Array
(
[Title] => happens.jpg
[Summary] => Nfl News Wire
[Url] => http://www.paradisehotel.gr/floppy/happens.jpg
[ClickUrl] => http://www.paradisehotel.gr/floppy/happens.jpg
[RefererUrl] => http://www.paradisehotel.gr/nfl/nfl-news-wire.htm
[FileSize] => 6516
[FileFormat] => jpeg
[Height] => 189
[Width] => 121
[Thumbnail] => Array
(
[Url] => http://re3.mm-a6.yimg.com/image/2147991319
[Height] => 125
[Width] => 80
)
)
Ive tried many things most look like echo $phpobj [ 'ResultSet' ] [ 'Result' ][ 0 ][ 1 ]; or echo [ 'ResultSet' ][ 0 ][ Title ];