PHPackages                             rych/bencode - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. rych/bencode

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

rych/bencode
============

Bencode serializer for PHP 5.3+

v1.0.0(12y ago)3122.3k—0%12[3 PRs](https://github.com/rchouinard/bencode/pulls)MITPHPPHP &gt;=5.3.4

Since Jan 13Pushed 5y ago4 watchersCompare

[ Source](https://github.com/rchouinard/bencode)[ Packagist](https://packagist.org/packages/rych/bencode)[ Docs](https://github.com/rchouinard/bencode)[ RSS](/packages/rych-bencode/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (3)Used By (0)

Bencode serialization for PHP
=============================

[](#bencode-serialization-for-php)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4ae7e24fc9c99d4ce2be29300469107671a47dcfff1c4a3e856b7aaa84f0dc50/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f727963682f62656e636f64652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rych/bencode)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/bfe113025de77b4b4dae40d9533b7d17e2bd8f2e9739084fcecbd4c717f8e220/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7263686f75696e6172642f62656e636f64652e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/rchouinard/bencode)[![Quality Score](https://camo.githubusercontent.com/fc930bb591941e2bb008de1154b950a7cdbb0821ce4ec1d8c10e83a760ba43c7/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f63343434633939612d323837302d343539622d393236382d3133633936313636653866372e7376673f7374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/c444c99a-2870-459b-9268-13c96166e8f7)[![Total Downloads](https://camo.githubusercontent.com/35fb31196fb496336afc17ab0ab26b7ae8697f17b95863c1a6d950cca6d27c19/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f727963682f62656e636f64652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rych/bencode)

This library allows developers to encode or decode bencoded data strings in PHP 5.3+. More information about bencode can be found at [Wikipedia](http://en.wikipedia.org/wiki/Bencode). The format is primarily used in the .torrent file specification.

Install
-------

[](#install)

Via Composer

```
$ composer require rych/bencode
```

Usage
-----

[](#usage)

### Encoding an array

[](#encoding-an-array)

```
