PHP code example of exinfinite / jsonld

1. Go to this page and download the library: Download exinfinite/jsonld 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/ */

    

exinfinite / jsonld example snippets


composer 

$jsonld = new Exinfinite\Jsonld("site name", "site url", "full url of site logo");
$jsonld->setTimezone("timezone");//default:"Asia/Taipei"

$jsonld->breadcrumb([
    'page1_url' => 'page1_title',
    'page2_url' => 'page2_title',
    'page3_url' => 'page3_title',
    ...
]);

$jsonld->search("full path of search url", "query_param");

$jsonld->article("page title", "page description", ["page thumbnail", "page thumbnail"], "page published date", "page modified date");

$jsonld->render();