Nope, no results. Problem is that it I think it never goes through the entire array that's inside the array. Always bumped into this problem myself.
First one just returns: Array
Second one returns:
The key "0" has index 'name' with the value "Array"
The key "1" has index 'name' with the value "Array"
The key "2" has index 'name' with the value "Array"
The key "3" has index 'name' with the value "Array"
The key "4" has index 'name' with the value "Array"
The key "5" has index 'name' with the value "Array"
etc.
Maybe it helps more if I post the entire code. First, I generate all the topartists from my Last.FM account, using the following code:
#################
## Retrieve Topartists ##
#################
$methodVars_Topartists = array(
'user' => 'Wechr',
'period' => 'overall'
);
$apiClass_Topartists = new lastfmApi();
$userClass = $apiClass_Topartists->getPackage($auth, 'user', $config);
if ( $artists = $userClass->getTopArtists($methodVars_Topartists) ) {
}
else {
die('<b>Error '.$userClass->error['code'].' - </b><i>'.$userClass->error['desc'].'</i>');
}
This generates the following array:
Array
(
[0] => Array
(
[name] => Sigur Rós
[rank] => 1
[playcount] => 2667
[mbid] => f6f2326f-6b25-4170-b89d-e235b25508e8
[url] => http://www.last.fm/music/Sigur+R%C3%B3s
[streamable] => 1
[images] => Array
(
[small] => http://userserve-ak.last.fm/serve/34/382318.jpg
[medium] => http://userserve-ak.last.fm/serve/64/382318.jpg
[large] => http://userserve-ak.last.fm/serve/126/382318.jpg
)
)
[1] => Array
(
[name] => Animal Collective
[rank] => 2
[playcount] => 1177
[mbid] => 0c751690-c784-4a4f-b1e4-c1de27d47581
[url] => http://www.last.fm/music/Animal+Collective
[streamable] => 1
[images] => Array
(
[small] => http://userserve-ak.last.fm/serve/34/28703999.jpg
[medium] => http://userserve-ak.last.fm/serve/64/28703999.jpg
[large] => http://userserve-ak.last.fm/serve/126/28703999.jpg
)
)
Now, I use this array to generate the top tags of every one of my top artists:
foreach ($artists as $key) {
$methodVars_Artisttags = array(
'artist' => $key['name']
);
$apiClass_Artisttags = new lastfmApi();
$artistClass = $apiClass_Artisttags->getPackage($auth, 'artist', $config);
if ( $tags = $artistClass->getTopTags($methodVars_Artisttags) ) {
} else {
die('<b>Error '.$artistClass->error['code'].' - </b><i>'.$artistClass->error['desc'].'</i>');
}
}
Which generates about 50 arrays like the one I showed earlier. Now I want to filter out all the url's (I indeed meant that, thorpe ) where ['name'] has the value 'indie'. I'm just not able to select it properly, always selecting the entire array.