1. Want to change the two-dimensional array to one-dimensional, delete the Arr value of one-dimensional key, do you have a function?
2. Array code:
StdClass object ([arr] = StdClass object ([0] = = StdClass Object ( [ID] [CID] = 221 [title] = Shenzhen Rail Transit network Operation control Center interior hardcover, glass curtain wall Project [Source] = = [Count] = 0 [img] = HTTP://UPLOAD.55.CN/SOURC e/44/201606/50457731d4be5e5c1.jpg [INFO] = [fee] = 0 [ur L] [/product/detail/14.html] [cate_name] = renovation works) [1] = StdClass Object ([id] = [cid] = [title] =&G T Nanchong Jialing River 1000T berth all Beijing pier [Source] = [count] = 0 [img] = htt p://upload.55.cn/source/44/201606/55557731d15a3aa42.jpg [INFO] = [fee] = 0 [uRL] =/product/detail/12.html [Cate_name] = water Conservancy and Power engineering)
How to remove arr? Otherwise, it is not graceful to use two foreach loops.
Reply content:
1. Want to change the two-dimensional array to one-dimensional, delete the Arr value of one-dimensional key, do you have a function?
2. Array code:
StdClass object ([arr] = StdClass object ([0] = = StdClass Object ( [ID] [CID] = 221 [title] = Shenzhen Rail Transit network Operation control Center interior hardcover, glass curtain wall Project [Source] = = [Count] = 0 [img] = HTTP://UPLOAD.55.CN/SOURC e/44/201606/50457731d4be5e5c1.jpg [INFO] = [fee] = 0 [ur L] [/product/detail/14.html] [cate_name] = renovation works) [1] = StdClass Object ([id] = [cid] = [title] =&G T Nanchong Jialing River 1000T berth all Beijing pier [Source] = [count] = 0 [img] = htt p://upload.55.cn/source/44/201606/55557731d15a3aa42.jpg [INFO] = [fee] = 0 [uRL] =/product/detail/12.html [Cate_name] = water Conservancy and Power engineering)
How to remove arr? Otherwise, it is not graceful to use two foreach loops.
$resultArr = $targetArr['arr'];
Did I get it wrong?
The object is supposed to be $result->arr.
Convert an object to an array
$a = $result [' arr '];