Home > php教程 > php手册 > 把数组生成树状结构(有图有真相)

把数组生成树状结构(有图有真相)

WBOY
Release: 2016-06-06 19:32:31
Original
1033 people have browsed it

这个类根据一个数组绘制一个树状的层次结构示意图。 颜色字体都可以修改 打包下载:http://www.codepearl.com/files/205.html PHP 源码与演示: 源码出处演示出处 ?php //www.codepearl.com include "class.diagram.php"; $g = new Diagram(); $arr = array(

这个类根据一个数组绘制一个树状的层次结构示意图。

颜色字体都可以修改

打包下载:http://www.codepearl.com/files/205.html PHP

源码与演示:源码出处 演示出处

把数组生成树状结构(有图有真相) 把数组生成树状结构(有图有真相)
<?php

  //www.codepearl.com
  include "class.diagram.php";

  $g = new Diagram();

  $arr = array(
  '旭文科技' => array(
         '研发部' =>array('总经理' => array('副经理','秘书'),'副经理'),
		 
		 '人事部' =>array('招聘组' => array('组长','员工'),'考勤组'=>array('组长','员工')),
		 
		 '客服部' =>array('电话销售' => array('组长','员工'),'技术支持'=>array('组长','员工')),
    ));
  
  $g->SetRectangleBorderColor(124, 128, 239);
  $g->SetRectangleBackgroundColor(194, 194, 239);
  $g->SetFontColor(0, 0, 0);
  $g->SetBorderWidth(0);
  $g->SetData($arr);
  $g->Draw();
?>
Copy after login
<?php

echo "类太大,移步http://www.codepearl.com/files/205.html下载";
Copy after login
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template