Skip to content

Latest commit

 

History

History
42 lines (27 loc) · 846 Bytes

README.md

File metadata and controls

42 lines (27 loc) · 846 Bytes

yocLib - OEmbed (PHP)

This yocLibrary enables your project to encode and decode OEmbed data in PHP.

Status

PHP Composer codecov

Installation

composer require yocto/yoclib-oembed

Usage

Encoding

use YOCLIB\OEmbed\OEmbed;

$data = [
    'version' => '1.0',
];

$json = OEmbed::encode($data,'json');
// or
$xml = OEmbed::encode($data,);

Decoding

use YOCLIB\OEmbed\OEmbed;

$json = '{"version":"1.0"}';
$data = OEmbed::decode($json,'json');

// or

$xml = '<oembed><version>1.0</version></oembed>';
$data = OEmbed::decode($xml);