Write a function to convert the data
$array = array(
0=>array("","Hebei"),
1=>array(""," Beijing"),
2=>array(0,"Baoding"),
3=>array(1,"Haidian"),
4=>array(3,"Zhongguancun" ),
5=>array(2,"Zhuozhou")
);
After processing, the return is as follows:
Hebei
-Baoding
-- Zhuozhou
Beijing
-Haidian
--Zhongguancun
Copy code The code is as follows:
function typeArray ($array){
$con = null; na[$v[0]].$k."|" : $k."|";
>$v){
$s = substr_count($v,"|"); 1]."n";
}
return $con;
http://www.bkjia.com/PHPjc/327956.html
www.bkjia.com
true
http: //www.bkjia.com/PHPjc/327956.html
TechArticleWrite a function to convert the data $array = array( 0=array("","Hebei"), 1 =array("","Beijing"), 2=array(0,"Baoding"), 3=array(1,"Haidian"), 4=array(3,"Zhongguancun"), 5=array(2, "Zhuozhou") ); Process...