danielwarner
03-02-2008, 05:16 PM
Previously i asked in this forum about finding information from torrent announcers and thanks to Inigoesdr :thumbsup: i found a useful resource. The problem i now face is how to extract the information from the arrays the code produces.
Heres an example of the code that the script produces using var_dump:
array(1) {
[0]=>
array(3) {
["announce"]=>
string(45) "[[[HTTP://ANNOUNCER URL.com]]]"
["creation date"]=>
int([[[UNIX TIMESTAMP]]])
["info"]=>
array(4) {
["files"]=>
array(14) {
[0]=>
array(2) {
["length"]=>
int([[[FILE no.1 LENGTH]]])
["path"]=>
array(1) {
[0]=>
string(52) "[[[FILE NAME]]]"
}
}
[1]=>
array(2) {
["length"]=>
int([[[FILE no.2 LENGTH]]])
["path"]=>
array(1) {
[0]=>
string(52) "[[[FILE NAME]]]"
}
}
[2]=>
array(2) {
["length"]=>
int([[[FILE no.3 LENGTH]]])
["path"]=>
array(1) {
[0]=>
string(52) "[[[FILE NAME]]]"
}
}
}
}
}
}
My problem is that if i were to want to access the file name of the second file in the array then i assume id want to use code similar to $name[1] = $torrent["info"]["files"][0]["path"][0]; although this doesn't work (most probably because its horribly wrong :/)
Can anyone correct me here where i'm wrong.
Thanks.
Heres an example of the code that the script produces using var_dump:
array(1) {
[0]=>
array(3) {
["announce"]=>
string(45) "[[[HTTP://ANNOUNCER URL.com]]]"
["creation date"]=>
int([[[UNIX TIMESTAMP]]])
["info"]=>
array(4) {
["files"]=>
array(14) {
[0]=>
array(2) {
["length"]=>
int([[[FILE no.1 LENGTH]]])
["path"]=>
array(1) {
[0]=>
string(52) "[[[FILE NAME]]]"
}
}
[1]=>
array(2) {
["length"]=>
int([[[FILE no.2 LENGTH]]])
["path"]=>
array(1) {
[0]=>
string(52) "[[[FILE NAME]]]"
}
}
[2]=>
array(2) {
["length"]=>
int([[[FILE no.3 LENGTH]]])
["path"]=>
array(1) {
[0]=>
string(52) "[[[FILE NAME]]]"
}
}
}
}
}
}
My problem is that if i were to want to access the file name of the second file in the array then i assume id want to use code similar to $name[1] = $torrent["info"]["files"][0]["path"][0]; although this doesn't work (most probably because its horribly wrong :/)
Can anyone correct me here where i'm wrong.
Thanks.