1. function arrayToTreeArray($rows) { if(!is_array($rows) || empty($rows) ){ return false; } // $rows = array(); //stores all the database rows that are to be converted into a tree $tree = array(); //stores the tree $tree_index = array(); //an array used to quickly find nodes in the tree $id_column = "idx"; //The column that contains the id of each node $parent_column = "pidx"; //The column that..