/    Sign up×
Community /Pin to ProfileBookmark

Multidimensional Array

I use Yahoo Pipes to get some content using the a serialized PHP:

[code]$request = “http://pipes.yahoo.com/pipes/pipe.run?_id=DsfnOGlK3BGw4DuRJZhxuA&_render=php&search=alias”;

$response = file_get_contents($request);

if ($response === false) {
die(‘Request failed’);
}

$phpobj = unserialize($response);
[/code]

I have a variable ($search) with the results from a form.
And the url should be something like this:
http://pipes.yahoo.com/pipes/pipe.run?_id=DsfnOGlK3BGw4DuRJZhxuA&_render=php&search=$search

The array I get from Pipes is a Multidimensional Array, like this:
[url]http://pastebin.com/m2a6649b4[/url]

What i need is a loop for the “title” and the “link”.

With the “link” as a href to the the title.

And I need to change the link from:
[url]http://www.mininova.org/get/1290875[/url]
to
http://” . $_SESSION[“user”] . $_SESSION[“pass”] . $_SESSION[‘host’] . “/gui/?action=get-url&s=” . urlencode([url]http://www.mininova.org/get/1290875[/url])

For example:
[url]http://username:[email protected]:9999/gui/?action=get-url&s=http%3A%2F%2Fwww.mininova.org%2Fget%2F1290875[/url]

I really hope someone can help me with this one ?

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@neilemrichApr 07.2008 — So you're looking for something like this:

[code=php]
foreach($phpobj[value][items] as $link) {
echo '<a href="http://'. $_SESSION["user"].':'.$_SESSION["pass"].'@'.$_SESSION['host']."/gui/?action=get-url&s=".urlencode($link["link"]).'">'.$link["title"].'</a><br />';
}
[/code]


?
Copy linkTweet thisAlerts:
@mofleauthorApr 07.2008 — Thanks, already got it thought ?
×

Success!

Help @mofle spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...