PHP code example of kumatch / domaintext
1. Go to this page and download the library: Download kumatch/domaintext 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/ */
kumatch / domaintext example snippets
use Kumatch\DomainText\Registry;
$domainName = "my_domain";
$registry->register($domainName, array(
"name" => "foo",
"item" => "apple",
10 => 100,
0 => "zero"
));
$domain = $registry->getDomain($domainName);
$name = $domain->get("name"); // $name = "foo"
$item = $domain->get("item"); // $item = "apple"
$num = $domain->get(10); // $num = 100
$zero = $domain->get(0); // $zero = "zero"
$person = $domain->get("person") // $person = "person", not blank or null.