In PHP, you can refer to Graphviz to make images. Graphviz probably already has a PHP shell, but it's pretty easy to name.
For example, this input file (in example.dot ):
digraph example { dlink1 [label="d-link"]; dlink2 [label="d-link"]; cisco -> dlink1; cisco -> dlink2; }
Can be converted to image:
$ dot -Tpng -o example.png example.dot
Here is the result:

source share