I've got an array generated from a SQL query :
<pre>
$df = $bdd->query('select * from V_Customer_Link where ref_customer in (select ref_customer from V_Customer_Link group by ref_customer having count(*) >=4)');
$result = $df->FetchAll();
$df->closeCursor();
</pre>
When I do a print_r($result)
I've got this :
Array ( [0] => Array ( [docno] => 59 [0] => 59 [ref_customer] => ALFKI [1] => ALFKI [type_de_document] => 2 [2] => 2 [TypeDeDoc] => Rib [3] => Rib [link] => http://localhost/TWA/Client/WEB/Viewer/Viewer.aspx?DocNo=59.1&child=true [4] => http://localhost/TWA/Client/WEB/Viewer/Viewer.aspx?DocNo=59.1&child=true ) [1] => Array ( [docno] => 60 [0] => 60 [ref_customer] => ALFKI [1] => ALFKI [type_de_document] => 1 [2] => 1 [TypeDeDoc] => Carte Identité [3] => Carte Identité [link] => http://localhost/TWA/Client/WEB/Viewer/Viewer.aspx?DocNo=60.1&child=true [4] => http://localhost/TWA/Client/WEB/Viewer/Viewer.aspx?DocNo=60.1&child=true ) [2] => Array ( [docno] => 61 [0] => 61 [ref_customer] => ALFKI [1] => ALFKI [type_de_document] => 3 [2] => 3 [TypeDeDoc] => Kbis [3] => Kbis [link] => http://localhost/TWA/Client/WEB/Viewer/Viewer.aspx?DocNo=61.2&child=true [4] => http://localhost/TWA/Client/WEB/Viewer/Viewer.aspx?DocNo=61.2&child=true ) [3] => Array ( [docno] => 62 [0] => 62 [ref_customer] => ALFKI [1] => ALFKI [type_de_document] => 4 [2] => 4 [TypeDeDoc] => Contrat [3] => Contrat [link] => http://localhost/TWA/Client/WEB/Viewer/Viewer.aspx?DocNo=62.2&child=true [4] => http://localhost/TWA/Client/WEB/Viewer/Viewer.aspx?DocNo=62.2&child=true ) [4] => Array ( [docno] => 66 [0] => 66 [ref_customer] => BOLID [1] => BOLID [type_de_document] => 4 [2] => 4 [TypeDeDoc] => Contrat [3] => Contrat [link] => http://localhost/TWA/Client/WEB/Viewer/Viewer.aspx?DocNo=66.1&child=true [4] => http://localhost/TWA/Client/WEB/Viewer/Viewer.aspx?DocNo=66.1&child=true ) [5] => Array ( [docno] => 67 [0] => 67 [ref_customer] => BOLID [1] => BOLID [type_de_document] => 1 [2] => 1 [TypeDeDoc] => Carte Identité [3] => Carte Identité [link] => http://localhost/TWA/Client/WEB/Viewer/Viewer.aspx?DocNo=67.1&child=true [4] => http://localhost/TWA/Client/WEB/Viewer/Viewer.aspx?DocNo=67.1&child=true ) [6] => Array ( [docno] => 68 [0] => 68 [ref_customer] => BOLID [1] => BOLID [type_de_document] => 3 [2] => 3 [TypeDeDoc] => Kbis [3] => Kbis [link] => http://localhost/TWA/Client/WEB/Viewer/Viewer.aspx?DocNo=68.1&child=true [4] => http://localhost/TWA/Client/WEB/Viewer/Viewer.aspx?DocNo=68.1&child=true ) [7] => Array ( [docno] => 69 [0] => 69 [ref_customer] => BOLID [1] => BOLID [type_de_document] => 5 [2] => 5 [TypeDeDoc] => Liasse Fiscale [3] => Liasse Fiscale [link] => http://localhost/TWA/Client/WEB/Viewer/Viewer.aspx?DocNo=69.1&child=true [4] => http://localhost/TWA/Client/WEB/Viewer/Viewer.aspx?DocNo=69.1&child=true ) [8] => Array ( [docno] => 70 [0] => 70 [ref_customer] => BOLID [1] => BOLID [type_de_document] => 2 [2] => 2 [TypeDeDoc] => Rib [3] => Rib [link] => http://localhost/TWA/Client/WEB/Viewer/Viewer.aspx?DocNo=70.1&child=true [4] => http://localhost/TWA/Client/WEB/Viewer/Viewer.aspx?DocNo=70.1&child=true ) )
As you can see, there is only two different ref_customer. In the future, there will be more.
I would like to display information from this array like this :
ALFKI : Rib, Carte Identité, Kbis, Contrat
BOLID : Rib, Carte Identité, Kbis, Contrat, Liasse fiscale
If I do a for or a while, the value ref_customer will be repeated each time. How can I limit this value once and get all the other?