Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- declare(strict_types = 1);
- use Graphp\GraphViz\GraphViz;
- use drupol\phptree\Converter\ValueGraph as Graph;
- use drupol\phptree\Node\ValueNode;
- include './vendor/autoload.php';
- $tree = new ValueNode('Bobbeh', 2);
- $data = 'who is your brogy now ?';
- $nodes = [];
- foreach (\explode(' ', $data) as $v) {
- $nodes[] = new ValueNode($v);
- }
- $tree->add(...$nodes);
- $graphViz = new GraphViz();
- $graph = new Graph();
- $graphViz->display($graph->convert($tree));
Add Comment
Please, Sign In to add comment