![How can I parse a .torrent file with PHP? [solved] How can I parse a .torrent file with PHP? [solved]](https://techblog.willshouse.com/wp-content/uploads/2012/12/how-can-i-parse-a-torrent-file-with-php-solved.png)
There are some similar questions, but most of them want to download a torrent using PHP or something like that. What I’d like to do is parse a `.torrent` file, add trackers to it, and then re-save it as a `.torrent` file.
– I saw Snark which looks to be for Java only.
Can I do this with PHP? If so, how?
##Solution
To parse a `.torrent` file with PHP you can use a standalone function, as demonstrated here or you can use a library, like the one included with php-bittorrent