PHPackages                             rehike/spfphp - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. rehike/spfphp

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

rehike/spfphp
=============

A PHP library for generating SPF.js-compatible page fragments.

1.0.5(3y ago)3332MITPHPPHP &gt;=7.0.0

Since Jun 4Pushed 2y agoCompare

[ Source](https://github.com/Rehike/SpfPhp)[ Packagist](https://packagist.org/packages/rehike/spfphp)[ Docs](https://github.com/Rehike/spfphp)[ RSS](/packages/rehike-spfphp/feed)WikiDiscussions main Synced 1mo ago

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

Deprecated
==========

[](#deprecated)

SpfPhp was mostly a Rehike-specific hack that should have been worked around a long time ago. For more efficient performance, this project will be deprecated and Rehike will move away from it in the future.

If you are a third-party user of the SpfPhp library, then feel free to make a fork and continue maintaining it.

SpfPhp
======

[](#spfphp)

A PHP library that parses and transforms HTML into the JSON required by YouTube's [SPF.js](//github.com/youtube/spfjs).

Installation
------------

[](#installation)

The recommended installation method is via [Composer](//getcomposer.org):

```
composer require rehike/spfphp
```

After installation, use the library like such:

```
require "vendor/autoload.php"; // Include Composer packages

use SpfPhp\SpfPhp;
```

Get started
-----------

[](#get-started)

SpfPhp is designed with the most portability in mind. With that, it does not require the use of or integrate with any particular templating engine.

To use this with any templating engine, or just PHP alone, simply wrap all output with these following functions:

```

        Example

        Hello world!
