1. Go to this page and download the library: Download torann/json-ld 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/ */
torann / json-ld example snippets
$context = \JsonLd\Context::create('local_business', [
'name' => 'Consectetur Adipiscing',
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor',
'telephone' => '555-555-5555',
'openingHours' => 'mon,tue,fri',
'address' => [
'streetAddress' => '112 Apple St.',
'addressLocality' => 'Hamden',
'addressRegion' => 'CT',
'postalCode' => '06514',
],
'geo' => [
'latitude' => '41.3958333',
'longitude' => '-72.8972222',
],
]);
echo $context; // Will output the script tag