hi every one, how are you folf , hope fine
dear Friends i want to get values of multi-dimensional arrays using foreach loop and after that print out the html using an other while loop ,
i tried alot but did not successed accutly i want to create an yahoo api websearch application i got a sample from developer.yahoo .com for this purpose ,this sample uses unserialize/serialize php
here is the code exapmle
allthogh this will show the result
and there numberiuos thing in that array which can be print by print_r(); function
but what i want to do increament dynamically the third value of array using a loop , but how to do that any help would be highly appriciated
dear Friends i want to get values of multi-dimensional arrays using foreach loop and after that print out the html using an other while loop ,
i tried alot but did not successed accutly i want to create an yahoo api websearch application i got a sample from developer.yahoo .com for this purpose ,this sample uses unserialize/serialize php
here is the code exapmle
Code:
<?php
// Parsing Yahoo! REST Web Service results using
// unserialize. PHP4/PHP5
// Author: Jason Levitt
// February 1, 2006
// output=php means that the request will return serialized PHP
$request = 'http://api.search.yahoo.com/WebSearchService/V1/webSearch?appid=dboyzclan&query=php sample&results=4&output=php';
$response = file_get_contents($request);
if ($response === false) {
die('Request failed');
}
$phpobj = unserialize($response);
echo '<pre>';
//this will print the arrays
print_r($phpobj);
echo '</pre>';
?>
Code:
<?php //show result no 1 //this will show the url of result 1 echo $phpobj['ResultSet']['Result']['0']['Url']; echo '<br>'; //this will show the title of result no 1 echo $phpobj['ResultSet']['Result']['0']['Title']; echo '<br>'; //this will show the Summary of result no 1 echo $phpobj['ResultSet']['Result']['0']['Summry']; echo '<br>'; //Result no 2 //this will show the url of result 2 echo $phpobj['ResultSet']['Result']['1']['Url']; echo '<br>'; //this will show the title of result no 2 echo $phpobj['ResultSet']['Result']['1']['Title']; echo '<br>'; //this will show the Summary of result no 2 echo $phpobj['ResultSet']['Result']['1']['Summry']; echo '<br>';?>
but what i want to do increament dynamically the third value of array using a loop , but how to do that any help would be highly appriciated
Comment