Explain a short segment of infinite classification code, foreach & nbsp; ($ rows & nbsp; as & nbsp; $ id & nbsp ;=& gt; & nbsp; $ item) & nbsp; {if & nbsp; ($ item ['pid ']) Ask the experts to interpret a short segment of infinite classification code ,,,
Foreach ($ rows as $ id => $ item)
{
If ($ item ['pid'])
{
$ Rows [$ item ['pid'] [$ item ['id'] = & $ rows [$ item ['id']; // This is the main part. can you elaborate on it?
$ T [] = $ id;
}
} Share an unlimited category :? $ Item )??? {If? ($ Item ['pid ']) ??? {$ Rows [$ item ['pid'] [$ I... 'data-pics = ''>
------ Solution --------------------
For
$rows = array(
1 => array( 'id' => 1, 'pid' => 0 ),
2 => array( 'id' => 2, 'pid' => 1 ),
3 => array( 'id' => 3, 'pid' => 2 ),
4 => array( 'id' => 4, 'pid' => 3 ),
);
$ Rows [$ item ['pid '] [$ item ['id'] = & $ rows [$ item ['id'];
The premise is that the keys and IDs of the array $ rows are the same.
------ Solution --------------------
<Identifier
Identifier;
A custom identifier, just like a string enclosed by "" or ''. it is enclosed by an identifier.
The identifier is user-defined. you can give it a name that is close to the content.