1. Go to this page and download the library: Download overtrue/double-array-trie 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/ */
overtrue / double-array-trie example snippets
use Overtrue\DoubleArrayTrie\Builder;
$builder = new Builder();
$trie = $builder->build(['foo', 'bar', 'baz']);
$trie->export()->toFile('trie.json');
$trie->export()->toFile('trie.php');
$trie->export()->toFile('trie.dat');
use Overtrue\DoubleArrayTrie\Builder;
$builder = new Builder();
$trie = $builder->build([
'一举' => 'yi ju',
'一举一动' => 'yi ju yi dong',
]);