Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.
/ schema Public archive

A PHP + MySQL implementation of structured data

License

Notifications You must be signed in to change notification settings

kernvalley/schema

Repository files navigation

Actions Status


A PHP & MySQL implementation of structured data

See

<?php
use \KernValley\Schema\{Person, ImageObject, PostalAddress};
$person = new Person();
$image = new ImageObject();
$address = new PostalAddress();

$image->setUrl('https://example.com/image/jpg');
$image->setHeight(480);
$image->setWidth(640);
$image->setEncodingFormat(ImageObject::JEPG);

$address->setStreetAddress('123 Some St.');
$address->setAddressLocality('City');
$address->setAddressRegion('CA');
$address->setPostalCode(90210);
$address->setAddressCountry(PostalAddress::USA);

$person->setGivenName('First');
$person->setFamilyName('Last');
$person->setImage($image);
$person->setAddress($address);

header('Content-Type: ' . Person::CONTENT_TYPE);
echo json_encode($person);

About

A PHP + MySQL implementation of structured data

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages