https://github.com/yocto/yoclib-oembed-php
This yocLibrary enables your project to encode and decode OEmbed data in PHP.
https://github.com/yocto/yoclib-oembed-php
composer json oembed php xml yoclib yocto
Last synced: 5 months ago
JSON representation
This yocLibrary enables your project to encode and decode OEmbed data in PHP.
- Host: GitHub
- URL: https://github.com/yocto/yoclib-oembed-php
- Owner: yocto
- License: gpl-3.0
- Created: 2024-10-01T20:02:41.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-10-02T13:28:55.000Z (over 1 year ago)
- Last Synced: 2025-09-27T04:28:53.983Z (8 months ago)
- Topics: composer, json, oembed, php, xml, yoclib, yocto
- Language: PHP
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# yocLib - OEmbed (PHP)
This yocLibrary enables your project to encode and decode OEmbed data in PHP.
## Status
[](https://github.com/yocto/yoclib-oembed-php/actions/workflows/php.yml)
[](https://codecov.io/gh/yocto/yoclib-oembed-php)
## Installation
`composer require yocto/yoclib-oembed`
## Usage
### Encoding
```php
use YOCLIB\OEmbed\OEmbed;
$data = [
'version' => '1.0',
];
$json = OEmbed::encode($data,'json');
// or
$xml = OEmbed::encode($data,);
```
### Decoding
```php
use YOCLIB\OEmbed\OEmbed;
$json = '{"version":"1.0"}';
$data = OEmbed::decode($json,'json');
// or
$xml = '1.0';
$data = OEmbed::decode($xml);
```