【问题标题】:PHP change Array key value to multiple keys and values in multi-dimensional arrayPHP将Array键值更改为多维数组中的多个键和值
【发布时间】:2016-12-30 10:05:41
【问题描述】:

下面有一个序列化和非序列化的多维数组。我试图将这个数组中每个名为“id”的键的值分解为四个新键...

$array_seril = 'a:9:{i:0;a:1:{s:2:"id";s:42:"about.php///关于我们///关于我们///关于我们" ;}i:1;a:2:{s:2:"id";s:37:"products.php?la=men///Men///Men///Men";s:8:" children";a:2:{i:0;a:2:{s:2:"id";s:86:"products.php?la=men&lb=All-Clothing///所有服装///所有服装///男士:所有服装";s:8:"儿童";a:5:{i:0;a:2:{s:2:"id";s:159:"products.php?la =men&lb=All-Clothing&lc=Winter-AnD-Seasonal-Wear///Winter & Seasonal Wear///Winter & Seasonal Wear///男士:所有服装:Winter & Seasonal Wear";s:8:"children"; a:3:{i:0;a:1:{s:2:"id";s:150:"products.php?la=men&lb=All-Clothing&lc=Winter-AnD-Seasonal-Wear&ld=夹克// /夹克///夹克///男士:所有服装:冬季和季节性服装:夹克";}i:1;a:1:{s:2:"id";s:174:"products.php?la =men&lb=All-Clothing&lc=Winter-AnD-Seasonal-Wear&ld=Thermal-Pants///Thermal Pants///Thermal Pants///男士:所有服装:冬季和季节性穿着:Thermal Pants";}i:2; a:2:{s:2:"id";s:184:"products.php?la=men&lb=All-Clothing&lc=Winter-AnD-Seasonal-Wear&ld=Suits-AnD-Blazers ///西装和西装外套///西装和西装外套///男士:所有服装:冬季和季节性服装:西装和西装外套";s:8:"children";a:1:{i:0;a:1 :{s:2:"id";s:189:"products.php?la=men&lb=All-Clothing&lc=Winter-AnD-Seasonal-Wear&ld=Suits-AnD-Blazers&le=Blazers///Blazers///Blazers ///男士:所有服装:冬季和季节性服装:西装和西装外套:西装外套";}}}}}i:1;a:1:{s:2:"id";s:89:"products.php ?la=men&lb=All-Clothing&lc=Other///Other///Other///Men : All Clothing : Other";}i:2;a:2:{s:2:"id";s:93 :"products.php?la=men&lb=All-Clothing&lc=衬衫///衬衫///衬衫///男士:所有服装:衬衫";s:8:"children";a:1:{i:0 ;a:1:{s:2:"id";s:140:"products.php?la=men&lb=All-Clothing&lc=衬衫&ld=Formal-Shirts///Formal Shirts///Formal Shirts///Men : 所有服装 : 衬衫 : 正式衬衫";}}}i:3;a:2:{s:2:"id";s:113:"products.php?la=men&lb=All-Clothing&lc=Sports-Wear ///运动装///运动装///男士:所有服装:运动装";s:8:"children";a:4:{i:0;a:1:{s:2:"id ";s:142:"products.php?la=men&lb=All-Clothing&lc=Sports-W ear&ld=Track-Pants///Track Pants///Track Pants///男士:所有服装:运动装:Track Pants";}i:1;a:2:{s:2:"id";s: 122:"products.php?la=men&lb=All-Clothing&lc=Sports-Wear&ld=Shorts///Shorts///Shorts///Men : All Clothing : Sports Wear : Shorts";s:8:"children"; a:2:{i:0;a:1:{s:2:"id";s:141:"products.php?la=men&lb=All-Clothing&lc=运动装&ld=短裤&le=运动///运动///运动///男士:所有服装:运动装:短裤:运动";}i:1;a:1:{s:2:"id";s:137:"products.php?la=men&lb =所有服装&lc=运动服&ld=短裤&le=其他///其他///其他///男士:所有服装:运动服:短裤:其他";}}}i:2;a:1:{s: 2:"id";s:133:"products.php?la=men&lb=All-Clothing&lc=Sports-Wear&ld=TDaShShirts///T 恤///T 恤///男士:所有服装:运动装: T 恤";}i:3;a:1:{s:2:"id";s:118:"products.php?la=men&lb=All-Clothing&lc=Sports-Wear&ld=Other///Other ///其他///男士:所有服装:运动服:其他";}}}i:4;a:1:{s:2:"id";s:89:"products.php?la=men&lb =所有服装&lc=牛仔裤///牛仔裤///牛仔裤///M en : All Clothing : Jeans";}}}i:1;a:2:{s:2:"id";s:70:"products.php?la=men&lb=Footwear///Footwear///Footwear ///男士:鞋类";s:8:"children";a:4:{i:0;a:1:{s:2:"id";s:109:"products.php?la=men&lb =鞋类&lc=休闲鞋///休闲鞋///休闲鞋///男士:鞋类:休闲鞋";}i:1;a:1:{s:2:"id";s:85:" products.php?la=men&lb=鞋类&lc=运动///运动///运动///男士:鞋类:运动";}i:2;a:1:{s:2:"id";s:141 :"products.php?la=men&lb=Footwear&lc=Sandals-and-Floaters///Sandals-and-Floaters///Sandals and Floaters///男士:鞋类:Sandals and Floaters";}i:3;a:1: {s:2:"id";s:145:"products.php?la=men&lb=Footwear&lc=Slippers-and-FlipFlop///拖鞋和人字拖///拖鞋和人字拖///男士:鞋类:拖鞋和FlipFlop";}}}}}i:2;a:2:{s:2:"id";s:45:"products.php?la=women///Women///Women///Women" ;s:8:"儿童";a:1:{i:0;a:2:{s:2:"id";s:86:"products.php?la=women&lb=Ethnic-Wear///民族服饰///民族服饰///女性:民族服饰";s:8:"children";a:3:{i:0;a:1:{s:2:"id";s:91: “产品.php ?la=women&lb=民族服饰&lc=Other///Other///Other///女性:民族服饰:Other";}i:1;a:2:{s:2:"id";s:137 :"products.php?la=women&lb=Ethnic-Wear&lc=Kurtas-AnD-Kurties///Kurtas & Kurties///Kurtas & Kurties///女性:民族服饰:Kurtas & Kurties";s:8:"儿童";a:1:{i:0;a:1:{s:2:"id";s:140:"products.php?la=women&lb=Ethnic-Wear&lc=Kurtas-AnD-Kurties&ld=Kurties// /Kurties///Kurties///女性:民族服饰:Kurtas & Kurties:Kurties";}}}i:2;a:2:{s:2:"id";s:127:"products.php? la=women&lb=民族服饰&lc=民族服饰///民族服饰///民族服饰///女装:民族服饰:民族服饰";s:8:"儿童";a:2:{i:0; a:1:{s:2:"id";s:150:"products.php?la=women&lb=Ethnic-Wear&lc=Ethnic-Bottoms&ld=Harem-Pants///哈伦裤///哈伦裤///女性:民族服饰:民族服饰:后宫裤";}i:1;a:2:{s:2:"id";s:180:"products.php?la=women&lb=民族服饰&lc=民族服饰&ld =Patialas-AnD-Salwars///Patialas & Salwars///Patialas & Salwars///女装:民族服饰:民族底裤:Patialas & Salwars";s:8:"儿童";a:2:{i:0;a:1:{s:2:"id";s:179:"products.php?la=women&lb=Ethnic-Wear&lc=Ethnic-Bottoms&ld=Patialas-AnD- Salwars&le=Salwars///Salwars///Salwars///女装:民族服饰:民族底裤:Patialas & Salwars:Salwars";}i:1;a:1:{s:2:"id";s:183 :"products.php?la=women&lb=Ethnic-Wear&lc=Ethnic-Bottoms&ld=Patialas-AnD-Salwars&le=Patialas///Patialas///Patialas///女性:民族服饰:民族下装:Patialas & Salwars:Patialas" ;}}}}}}}}}i:3;a:2:{s:2:"id";s:41:"products.php?la=bags///Bags///Bags/// Bags";s:8:"children";a:2:{i:0;a:2:{s:2:"id";s:56:"products.php?la=bags&lb=Bags///包///包///包:包";s:8:"儿童";a:2:{i:0;a:1:{s:2:"id";s:75:"产品。 php?la=bags&lb=Bags&lc=Other///Other///Other///Bags : Bags : Other";}i:1;a:1:{s:2:"id";s:91:" products.php?la=bags&lb=Bags&lc=Hand-Bags///Hand Bags///Hand Bags///Bags : Bags : Hand Bags";}}}i:1;a:2:{s:2: "id";s:112:"products.php?la=bags&lb=Luggage-and-Travel///行李和旅行///行李和旅行///包:行李和旅行";s:8:"chil dren";a:2:{i:0;a:1:{s:2:"id";s:127:"products.php?la=bags&lb=Luggage-and-Travel&lc=Duffel-Bags/// Duffel Bags///Duffel Bags///Bags : Luggage and Travel : Duffel Bags";}i:1;a:1:{s:2:"id";s:119:"products.php?la=bags&lb =Luggage-and-Travel&lc=手提箱///手提箱///手提箱///包:行李和旅行:手提箱";}}}}}i:4;a:2:{s:2:"id"; s:53:"products.php?la=eyewear///Eyewear///Eyewear///Eyewear";s:8:"children";a:1:{i:0;a:1:{s: 2:"id";s:106:"products.php?la=eyewear&lb=Spectacle-Frame///眼镜架///眼镜架///眼镜:眼镜架";}}}i:5;a: 1:{s:2:"id";s:53:"products.php?la=watches///Watches///Watches///Watches";}i:6;a:2:{s:2 :"id";s:69:"products.php?la=jewelleries///Jewelleries///Jewelleries///Jewelleries";s:8:"children";a:4:{i:0;a: 1:{s:2:"id";s:82:"products.php?la=jewelleries&lb=Earings///Earings///Earings///Jewelleries : Earings";}i:1;a:2: {s:2:"id";s:134:"products.php?la=jewelleries&lb=项链和链子///项链和链子///项链和链子///珠宝:项链acse and Chains";s:8:"children";a:2:{i:0;a:1:{s:2:"id";s:121:"products.php?la=jewelleries&lb=Necklacse- and-Chains&lc=Other///Other///Other///Jewelleries : Necklacse and Chains : Other";}i:1;a:1:{s:2:"id";s:137:"products. php?la=jewelleries&lb=项链和链子&lc=项链///项链///项链///珠宝:项链和链子:项链";}}}i:2;a:2:{s:2:" id";s:98:"products.php?la=jewelleries&lb=Accessories///Accessories///Accessories///Jewelleries : Accessories";s:8:"children";a:1:{i:0; a:1:{s:2:"id";s:115:"products.php?la=jewelleries&lb=Accessories&lc=胸针///胸针///胸针///珠宝:配饰:胸针";}}} i:3;a:1:{s:2:"id";s:82:"products.php?la=jewelleries&lb=Anklets///Anklets///Anklets///Jewelleries : Anklets";}}} i:7;a:2:{s:2:"id";s:69:"products.php?la=electronics///Electronics///Electronics///Electronics";s:8:"children" ;a:2:{i:0;a:2:{s:2:"id";s:134:"products.php?la=electronics&lb=Computer-Peripherals///电脑外设///电脑外设/ //电nics : 计算机外围设备";s:8:"children";a:1:{i:0;a:2:{s:2:"id";s:133:"products.php?la=electronics&lb=Computer -外围设备&lc=打印机///打印机///打印机///电子:计算机外围设备:打印机";s:8:"children";a:1:{i:0;a:1:{s:2:" id";s:216:"products.php?la=electronics&lb=Computer-Peripherals&lc=Printers&ld=Single-Function-Printer///单功能打印机///单功能打印机///电子:计算机外设:打印机:单功能打印机";}}}}}i:1;a:1:{s:2:"id";s:82:"products.php?la=electronics&lb=Mobiles///Mobiles///Mobiles// /电子产品:手机";}}}i:8;a:2:{s:2:"id";s:97:"products.php?la=homenfurnitures///家居和家具///家居和家具///家居和家具";s:8:"children";a:3:{i:0;a:1:{s:2:"id";s:86:"products.php?la=homenfurnitures&lb =Other///Other///Other///家居和家具:Other";}i:1;a:1:{s:2:"id";s:124:"products.php?la=homenfurnitures&lb =Lights-And-Lamps///灯和灯///灯和灯///家居和家具:灯和灯";}i:2; a:2:{s:2:"id";s:152:"products.php?la=homenfurnitures&lb=Dinnerware-AnD-Crockery///Dinnerware & Crockery///Dinnerware & Crockery///家居和家具:餐具和陶器";s:8:"儿童";a:1:{i:0;a:1:{s:2:"id";s:175:"products.php?la=homenfurnitures&lb=Dinnerware- AnD-Crockery&lc=Cups-AnD-Saucers///Cups & Saucers///Cups & Saucers///家居和家具:餐具和陶器:Cups & Saucers";}}}}}}'; $array_unserl = unserialize($array_seril); print_r($array_unserel);

看起来像这样:

大批 ( [0] => 数组 ( [url] => about.php [otitle] => 关于我们 [utitle] => 关于我们 [ttip] => 关于我们 ) [1] => 数组 ( [url] => products.php?la=men [otitle] => 男士 [utitle] => 男人 [ttip] => 男士 [孩子] => 数组 ( [url] => products.php?la=men&lb=All-Clothing [otitle] => 所有服装 [utitle] => 所有服装 [ttip] => 男士:所有服装 [孩子] = > 数组

我怎样才能做到这一点,请帮助

请复制您的 php 文件中的第一个蓝框代码并在您的服务器(..local)中运行 print_r($array_unserel); 你将能够清楚地看到“id”键和完整的数组

这是原始数组视图的示例

大批 ( [0] => 数组 ( [id] => about.php///关于我们///关于我们///关于我们 ) [1] => 数组 ( [id] => products.php?la=men///Men///Men///Men [孩子] => 数组 ( [0] => 数组 ( [id] => products.php?la=men&lb=All-Clothing///All Clothing///All Clothing///Men : All Clothing [孩子] => 数组 ( [0] => 数组 ( [id] => products.php?la=men&lb=All-Clothing&lc=Winter-AnD-Seasonal-Wear///Winter & Seasonal Wear///Winter & Seasonal Wear///男士:所有服装:Winter & Seasonal Wear [孩子] => 数组 ( [0] => 数组 ( [id] => products.php?la=men&lb=All-Clothing&lc=Winter-AnD-Seasonal-Wear&ld=夹克///夹克///夹克///男士:所有服装:冬季和季节性服装:夹克 ) [1] => 数组 ( [id] => products.php?la=men&lb=All-Clothing&lc=Winter-AnD-Seasonal-Wear&ld=Thermal-Pants///Thermal Pants///Thermal Pants///男士:所有服装:冬季和季节性服装: 保暖裤 ) [2] => 数组 ( [id] => products.php?la=men&lb=All-Clothing&lc=Winter-AnD-Seasonal-Wear&ld=Suits-AnD-Blazers///Suits & Blazers///Suits & Blazers///男士:所有服装:冬季和季节性服装:西装和西装外套 [孩子] => 数组 ( [0] => 数组 ( [id] => products.php?la=men&lb=All-Clothing&lc=Winter-AnD-Seasonal-Wear&ld=Suits-AnD-Blazers&le=Blazers///Blazers///Blazers///Men : All Clothing : Winter &季节性服装:西装和西装外套:西装外套 ) ) ) ) ) [1] => 数组 ( [id] => products.php?la=men&lb=All-Clothing&lc=Other///Other///Other///Men : All Clothing : Other ) [2] => 数组 ( [id] => products.php?la=men&lb=All-Clothing&lc=衬衫///衬衫///衬衫///男士:所有服装:衬衫 [孩子] => 数组 ( [0] => 数组 ( [id] => products.php?la=men&lb=All-Clothing&lc=衬衫&ld=正装///正装///正装///男士:所有服装:衬衫:正装 ) ) ) [3] => 数组 ( [id] => products.php?la=men&lb=All-Clothing&lc=Sports-Wear///运动装///运动装///男士:所有服装:运动装 [孩子] => 数组 ( [0] => 数组 ( [id] => products.php?la=men&lb=All-Clothing&lc=Sports-Wear&ld=Track-Pants///Track Pants///Track Pants///Men : All Clothing : Sports Wear : Track Pants ) [1] => 数组 ( [id] => products.php?la=men&lb=All-Clothing&lc=Sports-Wear&ld=Shorts///Shorts///Shorts///男士:所有服装:运动装:短裤 [孩子] => 数组 ( [0] => 数组 ( [id] => products.php?la=men&lb=All-Clothing&lc=Sports-Wear&ld=Shorts&le=Sports///Sports///Sports///Men : All Clothing : Sports Wear : Shorts : Sports ) [1] => 数组 ( [id] => products.php?la=men&lb=All-Clothing&lc=Sports-Wear&ld=Shorts&le=Other///Other///Other///男士:所有服装:运动装:短裤:其他 ) ) ) [2] => 数组 ( [id] => products.php?la=men&lb=All-Clothing&lc=Sports-Wear&ld=TDaShShirts///T 恤///T 恤///男士:所有服装:运动装:T 恤 ) [3] => 数组 ( [id] => products.php?la=men&lb=All-Clothing&lc=Sports-Wear&ld=Other///Other///Other///男士:所有服装:运动装:其他 ) ) ) [4] => 数组 ( [id] => products.php?la=men&lb=All-Clothing&lc=Jeans///Jeans///Jeans///男士:所有服装:牛仔裤 ) ) ) [1] => 数组 ( [id] => products.php?la=men&lb=鞋类///鞋类///鞋类///男士:鞋类 [孩子] => 数组 ( [0] => 数组 ( [id] => products.php?la=men&lb=Footwear&lc=休闲鞋///休闲鞋///休闲鞋///男士:鞋类:休闲鞋 ) [1] => 数组 ( [id] => products.php?la=men&lb=鞋类&lc=运动///运动///运动///男士:鞋类:运动 ) [2] => 数组 ( [id] => products.php?la=men&lb=Footwear&lc=Sandals-and-Floaters///Sandals and Floaters///Sandals and Floaters///男士:鞋类:Sandals and Floaters ) [3] => 数组 ( [id] => products.php?la=men&lb=Footwear&lc=Slippers-and-FlipFlop///拖鞋和人字拖///拖鞋和人字拖///男士:鞋类:拖鞋和人字拖 ) ) ) ) ) [2] => 数组 ( [id] => products.php?la=women///女性///女性///女性 [孩子] => 数组 ( [0] => 数组 ( [id] => products.php?la=women&lb=Ethnic-Wear///Ethnic Wear///Ethnic Wear///Women : Ethnic-Wear [孩子] => 数组 ( [0] => 数组 ( [id] => products.php?la=women&lb=Ethnic-Wear&lc=Other///Other///Other///Women : Ethnic Wear : Other ) [1] => 数组 ( [id] => products.php?la=women&lb=Ethnic-Wear&lc=Kurtas-AnD-Kurties///Kurtas & Kurties///Kurtas & Kurties///女性:民族服饰:Kurtas & Kurties [孩子] => 数组 ( [0] => 数组 ( [id] => products.php?la=women&lb=Ethnic-Wear&lc=Kurtas-AnD-Kurties&ld=Kurties///Kurties///Kurties///女性:民族服饰:Kurtas & Kurties:Kurties ) ) ) [2] => 数组 ( [id] => products.php?la=women&lb=Ethnic-Wear&lc=Ethnic-Bottoms///Ethnic Bottoms///Ethnic Bottoms///Women : Ethnic Wear : Ethnic Bottoms [孩子] => 数组 ( [0] => 数组 ( [id] => products.php?la=women&lb=Ethnic-Wear&lc=Ethnic-Bottoms&ld=Harem-Pants///Harem Pants///Harem Pants///Women : Ethnic Wear : Ethnic Bottoms : Harem Pants ) [1] => 数组 ( [id] => products.php?la=women&lb=Ethnic-Wear&lc=Ethnic-Bottoms&ld=Patialas-AnD-Salwars///Patialas & Salwars///Patialas & Salwars///女性:民族服饰:民族下装:Patialas & 萨尔瓦 [孩子] => 数组 ( [0] => 数组 ( [id] => products.php?la=women&lb=Ethnic-Wear&lc=Ethnic-Bottoms&ld=Patialas-AnD-Salwars&le=Salwars///Salwars///Salwars///女装:民族服饰:民族风下装:Patialas & Salwars : 萨尔瓦斯 ) [1] => 数组 ( [id] => products.php?la=women&lb=Ethnic-Wear&lc=Ethnic-Bottoms&ld=Patialas-AnD-Salwars&le=Patialas///Patialas///Patialas///女性:民族服饰:民族下装:Patialas & Salwars : 帕提拉斯 ) ) ) ) ) ) ) ) ) [3] => 数组 ( [id] => products.php?la=bags///Bags///Bags///Bags [孩子] => 数组 ( [0] => 数组 ( [id] => products.php?la=bags&lb=Bags///Bags///Bags///Bags : 包 [孩子] => 数组 ( [0] => 数组 ( [id] => products.php?la=bags&lb=Bags&lc=Other///Other///Other///Bags : Bags : Other ) [1] => 数组 ( [id] => products.php?la=bags&lb=Bags&lc=Hand-Bags///Hand-Bags///Hand Bags///Bags : Bags : Hand Bags ) ) ) [1] => 数组 ( [id] => products.php?la=bags&lb=Luggage-and-Travel///行李和旅行///行李和旅行///包:行李和旅行 [孩子] => 数组 ( [0] => 数组 ( [id] => products.php?la=bags&lb=Luggage-and-Travel&lc=Duffel-Bags///Duffel Bags///Duffel Bags///Bags : Luggage and Travel : Duffel Bags ) [1] => 数组 ( [id] => products.php?la=bags&lb=Luggage-and-Travel&lc=Suitcases///Suitcases///Suitcases///Bags : Luggage and Travel : Suitcases ) ) ) ) ) [4] => 数组 ( [id] => products.php?la=eyewear///眼镜///眼镜///眼镜 [孩子] => 数组 ( [0] => 数组 ( [id] => products.php?la=eyewear&lb=Spectacle-Frame///眼镜架///眼镜架///眼镜:眼镜架 ) ) ) [5] => 数组 ( [id] => products.php?la=watches///Watches///Watches///Watches ) [6] => 数组 ( [id] => products.php?la=jewelleries///珠宝首饰///珠宝首饰///珠宝首饰 [孩子] => 数组 ( [0] => 数组 ( [id] => products.php?la=jewelleries&lb=Earings///Earings///Earings///珠宝:耳环 ) [1] => 数组 ( [id] => products.php?la=jewelleries&lb=项链和链子///项链和链子///项链和链子///珠宝:项链和链子 [孩子] => 数组 ( [0] => 数组 ( [id] => products.php?la=jewelleries&lb=Necklacse-and-Chains&lc=Other///Other///Other///Jewelleries : Necklacse and Chains : 其他 ) [1] => 数组 ( [id] => products.php?la=jewelleries&lb=项链和链子&lc=项链///项链///项链///珠宝:项链和链子:项链 ) ) ) [2] => 数组 ( [id] => products.php?la=jewelleries&lb=Accessories///Accessories///Accessories///Jewelleries : 配饰 [孩子] => 数组 ( [0] => 数组 ( [id] => products.php?la=jewelleries&lb=Accessories&lc=胸针///胸针///胸针///珠宝:配饰:胸针 ) ) ) [3] => 数组 ( [id] => products.php?la=jewelleries&lb=脚链///脚链///脚链///珠宝:脚链 ) ) ) )

【问题讨论】:

  • 请同时提及您的预期结果。
  • 什么id ?您的示例中没有id
  • 如果您将复制 php 文件中的第一个块代码并使用
    print_r($array_unserel);
    在服务器中运行,您将能够看到“id”和整个数组清晰
  • @AnupSurin 我建议把这个结果放在你的问题中,这样并不是每个看到这个的人都必须运行它来看看原来的样子。
  • @AnupSurin result 不是说明。人们不想运行代码只是为了能够查看一个问题^^,例如,自己运行该代码,并在那里复制该输出。并明确指出这是您开始使用的数组,并且您在问题中拥有的数组是您想要的输出

标签: php arrays multidimensional-array


【解决方案1】:

您可以使用array_walk_recursive 遍历数组元素,然后使用explode 拆分单词:

array_walk_recursive($array_unserl, function(&$value, $key) {
    $tempArr = [];
    if($key == "id") {
        list($tempArr['url'],$tempArr['otitle'],$tempArr['utitle'],$tempArr['ttip']) = explode('///', $value);
    }
    $value = $tempArr;
});

print_r($array_unserl);

这会将您的 id 键值替换为展开的内容。像这样的:

[id] => Array
(
    [url] => about.php
    [otitle] => About Us
    [utitle] => About Us
    [ttip] => About US
)

【讨论】:

  • 嗨,Tamilan,我怎么看结果,你能解释一下吗?我得到了一个结果。
  • 使用相同的print_r($array_unserl);
  • 不要检查array_walk_recursive的返回值(它返回一个成功/失败的布尔值),但是你的数组;)
  • 我检查了 print_r($array_unserl);正在向我展示原始数组。
  • 我把 $tempArr = [ ]; 改为 $tempArr = array();。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-09-20
  • 2019-10-16
相关资源
最近更新 更多