(PHP)我有这个数组:
Array
(
[101] => Category Level One
[112] => Second Name Category
[173] => Suzete,Biberoane
[177] => Carucioare
[178] => Centre Activitati, Carusele
[180] => Scaune Auto Accesorii
[182] => Mobilier Bebelusi
[113] => Jucarii de Exterior
[203] => Leagane, ToboganeBalansoare
[119] => Jucarii Educative
[147] => Vehicule, BicicleteTriciclete
[272] => Biciclete Triciclete
[274] => Vehicule Diverse
[102] => Category Level One Blabla
[115] => Another Second Category
[276] => Laptopuri
[277] => Tablete
[278] => Accesorii Laptopuri
[281] => Genti Laptopuri
[282] => Memorii Laptopuri
[283] => Coolere Laptopuri
[279] => Accesorii Tablete
[116] => Yet Another Second Categ
[287] => Desktop PC
[288] => Monitoare
[117] => Componente & Periferice
[289] => Componente PC
)
现在这是一个类别列表,包括 parents 和 children 。如何根据空格数 / 来判断一个节点的父节点。
我想把它放到一个 mysql 数据库中,我需要知道每个类别的值/名称/父级。