Skip to content

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

License

Notifications You must be signed in to change notification settings

yocto/yoclib-oembed-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);