I am generating an php array and then converting it to a xml playlist. converting array to xml is no problem, but i am having problem generating the array. I am getting data from DB and want to use it. My code is like bellow-
$songs2008 = get_data("musics", "where year='2008'");
$mysongs = array();
foreach($songs2008 as $k1=>$v1){
$entry = array(
"url"=>"songs/main_songs/".$v1[file_name],
"songname"=>$v1[song_title],
"artist"=>$v1[artist]
);
array_push($mysongs, $entry);
}
and the array is -
$array = array(
"settings"=>array(
"width"=>"316",
"songs"=>array(
"albumArt"=>array(
"url"=>"songs/2008.jpg",
"entries"=>array(
"entry"=>$mysongs['0'],
"entry"=>$mysongs['1'],
"entry"=>$mysongs['2'],
----------------------
----------------------
)
)
)
);
Its not working at the entries. the array key is same(entry); so only one showing. is there any solution? any other way to do it? please help.