PHP code example of ajur-media / json-ld-generator
1. Go to this page and download the library: Download ajur-media/json-ld-generator 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/ */
ajur-media / json-ld-generator example snippets
$context = \AJUR\Toolkit\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