1. Go to this page and download the library: Download thanhsm/mediaembed library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
thanhsm / mediaembed example snippets
$input = 'Link here http://mp3.zing.vn/bai-hat/Vi-Ai-Vi-Anh-Dong-Nhi/ZW70UWO6.html';
$content = new MediaEmbed($input);
or
$content = MediaEmbed::process($input);
$contentProcessed = $content->getContent();
$content->hasMedia();
if ($content->hasMedia()) {
$media = $content->getMediaProvider();
}
//pixel
$media->setWidth(200);
$media->setHeight(100);
or
$media->setSize(200, 100);