Retrieve values from multimdimensional array
- by vincentlerry
I have a great difficulty. I need to retrieve [title], [url] and [abstract] values ??from this multidimensional array.
Also, I have to store those values in mysql database.
thanks in advance!!!
Array
(
[bossresponse] = Array
(
[responsecode] = 200
[limitedweb] = Array
(
[start] = 0
[count] = 20
[totalresults] = 972000
[results] = Array
(
[0] = Array
(
[date] =
[clickurl] = http://www.torchlake.com/
[url] = http://www.torchlake.com/
[dispurl] = www.torchlake.com
[title] = Torch Lake, COLI Inc, Highspeed, Dial-up, Wireless ...
[abstract] = Welcome to COLI Inc. Chain O' Lake Internet. Local Northern Michigan ISP, offering Dialup Internet access, Wireless access, Web design, and T1 services in Northern ...
)
[1] = Array
(
[date] =
[clickurl] = http://en.wikipedia.org/wiki/Torch_Lake_(Antrim_County,_Michigan)
[url] = http://en.wikipedia.org/wiki/Torch_Lake_(Antrim_County,_Michigan)
[dispurl] = en.wikipedia.org/wiki/Torch_Lake_(Antrim_County,_Michigan)
[title] = Torch Lake (Antrim County, Michigan) - Wikipedia, the free ...
[abstract] = Torch Lake at 19 miles (31 km) long is Michigan's longest lake and at approximately 18,770 acres (76 km²) is Michigan's second largest lake. Within it are several ...
)
this is the entire code that generates this array:
require("OAuth.php");
$cc_key = "";
$cc_secret = "";
$url = "http://yboss.yahooapis.com/ysearch/limitedweb";
$args = array();
$args["q"] = "car";
$args["format"] = "json";
$args["count"] = 20;
$consumer = new OAuthConsumer($cc_key, $cc_secret);
$request = OAuthRequest::from_consumer_and_token($consumer, NULL,"GET", $url, $args);
$request-sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $consumer, NULL);
$url = sprintf("%s?%s", $url, OAuthUtil::build_http_query($args));
$ch = curl_init();
$headers = array($request-to_header());
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$rsp = curl_exec($ch);
$results = json_decode($rsp, true);