Unlimited classification
foreach ($rows as $id = $item)
{
if ($item [' pid '])
{
$rows [$item [' PID ']][$item [' id ']] = & $rows [$item [' id ']]; This is the main part, can you explain it in detail?
$t [] = $id;
}
}
Reply to discussion (solution)
For
$rows = 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 role of this is
If the key of the array $rows is the same as the ID
Why does this & sign have the same effect as recursion?
For
$rows = 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 role of this is
If the key of the array $rows is the same as the ID
Moderators often write code like this: $sql =<< <> < p="">
<<< identifiers
Identifier
Custom identifiers, just as strings are enclosed in ",", here with the identity surround
Identifiers are naturally custom, and of course can give him a name that is close to the content.
<<< identifiers
Identifier
Custom identifiers, just as strings are enclosed in ",", here with the identity surround
Identifiers are naturally custom, and of course can give him a name that is close to the content.
Understand, Gray often thanks, but what is the effect of this writing? What is the general situation to use? I think the internet is used to escape the symbol, if so is not to avoid the safe handling function? But there are few online information.