osk Posted February 14, 2006 Report Share Posted February 14, 2006 No formas gribu izlasit ārā datus, kas ir ierakstīti masīvā: $masivs[1]='a'; $masivs[2]='b'; utt... Lasu ārā: for ($l=1;$l<(count($_POST['masivs'])+1);$l++){ echo ($l).'='.$_POST['masivs[$l]'].'<br>'; } Kā man realizēt šo: $_POST['masivs[$l]'] ????? Link to comment Share on other sites More sharing options...
bubu Posted February 14, 2006 Report Share Posted February 14, 2006 $_POST[$masivs[$l]] ? Link to comment Share on other sites More sharing options...
Kristabs Posted February 14, 2006 Report Share Posted February 14, 2006 lieto foreach() un nevajadzees taadu nesmuku for ciklu un lai saprastu, kaa dabuut aaraa to ko gribi, tad pasties ko izvada print_r($_POST), mosh sapratiisi kaads ir pieraksts $_POST[][] Link to comment Share on other sites More sharing options...
osk Posted February 14, 2006 Author Report Share Posted February 14, 2006 (edited) BUBU-Doma tāda, ar post tak var izveidot masīvu, nosūtot value=masivs[id] -> $masivs[1], $masivs[2] utt. Bet izsaucot post nevar izmantot masīvu, t.i., es nezinu kā. Ja izsaucu $_POST['masivs[$k]'], kur $k ir for cikls, tad nekas nestrādā. Vai to kaut kā var izdarīt vai nē? Edited February 14, 2006 by osk Link to comment Share on other sites More sharing options...
osk Posted February 14, 2006 Author Report Share Posted February 14, 2006 Kristabs Paldies, laikam sapratu :o) Link to comment Share on other sites More sharing options...
bubu Posted February 14, 2006 Report Share Posted February 14, 2006 $_POST["masivs[$k]"] ? vai arī nekā nesaprotu.. Link to comment Share on other sites More sharing options...
osk Posted February 14, 2006 Author Report Share Posted February 14, 2006 Tas ir divimensiju (laikam tā saucās) masīvs: $_POST[mainigais][$l] Link to comment Share on other sites More sharing options...
Recommended Posts