PHP code example of h2ero / php-trie-tree
1. Go to this page and download the library: Download h2ero/php-trie-tree 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/ */
h2ero / php-trie-tree example snippets
php
$trie = new \h2ero\TrieTree();
$trie->add("shit");
$result = $trie->find("oh shit");
var_dump($result);
$trie->add("吃瓜");
$result = $trie->find("oh shit, 吃瓜群众");
var_dump($result);
$trie->delete("shit");
$result = $trie->find("oh shit, 吃瓜群众");
var_dump($result);