Adding trie code in php