PHP regional classification sorting algorithm_PHP tutorial

WBOY
Release: 2016-07-21 15:01:54
Original
946 people have browsed it

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

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") ); Process...
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!