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...
Statement: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