1. Go to this page and download the library: Download jclyons52/page-preview 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/ */
[
"card" => "app",
"site" => "@TwitterDev",
"description" => "Cannonball is the fun way to create and share stories and poems on your phone. Start with a beautiful image from the gallery, then choose words to complete the story and share it with friends.",
"app" => [
"country" => "US",
"name" => [
"iphone" => "Cannonball",
"ipad" => "Cannonball",
"googleplay" => "Cannonball",
],
"id" => [
"iphone" => "929750075",
"ipad" => "929750075",
"googleplay" => "io.fabric.samples.cannonball",
],
"url" => [
"iphone" => "cannonball://poem/5149e249222f9e600a7540ef",
"ipad" => "cannonball://poem/5149e249222f9e600a7540ef",
"googleplay" => "http://cannonball.fabric.io/poem/5149e249222f9e600a7540ef",
],
]
];
php
$previewManager = PreviewManager::create();
$preview = $previewManager->fetch('https://somewebsite.com');
echo $preview->render(); // returns bootstrap media link preview
echo $preview->toJson(); // returns json string of preview attributes
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.