Am o problema si nu stiu cum sa o rezolv.
Am un array multidimensional si nu stiu cum sa fac count pe o anumita ramura.
Ex.:
Cod: Selectaţi tot
array (size=1)
38 =>
array (size=4)
'' =>
array (size=1)
'' =>
array (size=2)
833 =>
array (size=8)
'idP' => string '38' (length=2)
'denumireP' => string 'p 01-1111222' (length=15)
'idO' => null
'denumireO' => null
'idC' => null
'denumireC' => null
'idS' => string '833' (length=3)
'denumireS' => string 's1' (length=19)
880 =>
array (size=8)
'idP' => string '38' (length=2)
'denumireP' => string 'p 01-1111222' (length=15)
'idO' => null
'denumireO' => null
'idC' => null
'denumireC' => null
'idS' => string '880' (length=3)
'denumireS' => string 's2' (length=7)
4 =>
array (size=3)
3 =>
array (size=1)
813 =>
array (size=8)
'idP' => string '38' (length=2)
'denumireP' => string 'p 01-1111222' (length=15)
'idO' => string '4' (length=1)
'denumireO' => string '1/1112' (length=6)
'idC' => string '3' (length=1)
'denumireC' => string 'testpath1' (length=9)
'idS' => string '813' (length=3)
'denumireS' => string 's12' (length=16)
4 =>
array (size=1)
160 =>
array (size=8)
'idP' => string '38' (length=2)
'denumireP' => string 'p 01-1111222' (length=15)
'idO' => string '4' (length=1)
'denumireO' => string '1/1112' (length=6)
'idC' => string '4' (length=1)
'denumireC' => string 'C1234' (length=5)
'idS' => string '160' (length=3)
'denumireS' => string 'a22' (length=25)
5 =>
array (size=1)
812 =>
array (size=8)
'idP' => string '38' (length=2)
'denumireP' => string 'p 01-1111222' (length=15)
'idO' => string '4' (length=1)
'denumireO' => string '1/1112' (length=6)
'idC' => string '5' (length=1)
'denumireC' => string 'q1' (length=2)
'idS' => string '812' (length=3)
'denumireS' => string 's22' (length=16)
5 =>
array (size=3)
1 =>
array (size=1)
159 =>
array (size=8)
'idP' => string '38' (length=2)
'denumireP' => string 'p 01-1111222' (length=15)
'idO' => string '5' (length=1)
'denumireO' => string '2/1112' (length=6)
'idC' => string '1' (length=1)
'denumireC' => string 'test1' (length=5)
'idS' => string '159' (length=3)
'denumireS' => string 'ss11' (length=25)
4 =>
array (size=2)
814 =>
array (size=8)
'idP' => string '38' (length=2)
'denumireP' => string 'p 01-1111222' (length=15)
'idO' => string '5' (length=1)
'denumireO' => string '2/1112' (length=6)
'idC' => string '4' (length=1)
'denumireC' => string 'C1234' (length=5)
'idS' => string '814' (length=3)
'denumireS' => string 'sa11' (length=16)
816 =>
array (size=8)
'idP' => string '38' (length=2)
'denumireP' => string 'p 01-1111222' (length=15)
'idO' => string '5' (length=1)
'denumireO' => string '2/1112' (length=6)
'idC' => string '4' (length=1)
'denumireC' => string 'C1234' (length=5)
'idS' => string '816' (length=3)
'denumireS' => string '121ss' (length=16)
5 =>
array (size=1)
828 =>
array (size=8)
'idP' => string '38' (length=2)
'denumireP' => string 'p 01-1111222' (length=15)
'idO' => string '5' (length=1)
'denumireO' => string '2/1112' (length=6)
'idC' => string '5' (length=1)
'denumireC' => string 'q1' (length=2)
'idS' => string '828' (length=3)
'denumireS' => string '221' (length=20)
6 =>
array (size=1)
3 =>
array (size=1)
831 =>
array (size=8)
'idP' => string '38' (length=2)
'denumireP' => string 'p 01-1111222' (length=15)
'idO' => string '6' (length=1)
'denumireO' => string '3/1112' (length=6)
'idC' => string '3' (length=1)
'denumireC' => string 'testpath1' (length=9)
'idS' => string '831' (length=3)
'denumireS' => string 'asda11' (length=25)
Cod: Selectaţi tot
$or[$p][$o][$c][$s]['idp']=$row_result['id_p'];
$or[$p][$o][$c][$s]['denumirep']=$row_result['denumire_p'];
$or[$p][$o][$c][$s]['ido']=$row_result['id_o'];
$or[$p][$o][$c][$s]['denumireo']=$row_result['do'];
$or[$p][$o][$c][$s]['idCotatie']=$row_result['id_c'];
$or[$p][$o][$c][$s]['denumireCotatie']=$row_result['denumire_c'];
$or[$p][$o][$c][$s]['ids']=$row_result['id_s'];
$or[$p][$o][$c][$s]['denumires']=$row_result['denumire_s'];
Cod: Selectaţi tot
foreach ($or as $p) {
foreach ($p as $o){
foreach ($o as $c){
foreach ($c as $s)
Am facut un tabel html cu datele din select dar doresc sa scriu cu rowspan in locurile unde este nevoie.
Sper ca am explicat cat de bine.
Daca aveti intrebari si rezolvari le astept.
Astept raspuns.
Multumesc anticipat.
Cu stima Trif