Sandis Posted December 9, 2004 Report Share Posted December 9, 2004 (edited) Ir 4 masiivi (skatiit zemaak). Pirmo triis masiivu elementus var izvadiit, bet pasha peedeejaa masiiva elementus - nee! Izvadu shaadi: echo "elements: ". $GLOBALS["gal"][0][4][$_REQUEST["pi"]]; gal- masiiva numurs (ir vairaaki masiivi) [4] - masiivaa ir vairaaki masiivi (dotajaa gadiijumaa es veelos izvadiit masiiva 4. masiivu) pi - 4. masiiva pi-tais elements. Pats masiivs: array( '2002', # menu txt '2002', # folderis /lib/foldera vārds array('#264B5E','#FFB94D'), #bgcolor array('01.gif','02.gif'), # thumbnail array('01.jpg','02.jpg'), # big pic array('001.gif'','002.gif'') # left-side pic ) Viss straadaa, ja izvadu 1., 2., 3. masiiva elementus, bet 4. masiiva elementus neizdodas izvadiit - error - Undefined offset: 4 Edited December 9, 2004 by Sandis Link to comment Share on other sites More sharing options...
bubu Posted December 9, 2004 Report Share Posted December 9, 2004 Kas ir gal? Ja tas ir tavs piemēra masīvs, tad: $GLOBALS["gal"][0] = '2000'; Un stringam [4] nav labi pielietot! Link to comment Share on other sites More sharing options...
Sandis Posted December 9, 2004 Author Report Share Posted December 9, 2004 Tas skaidrs, bet kaa man izvadiit 001.gif, 002.gif!? Tam tachu jaaizskataas shaadi: echo "elements: ". $GLOBALS["gal"][0][4][1]]; echo "elements: ". $GLOBALS["gal"][0][4][2]]; Bet tas nestraadaa, es varu visu ieprieksheejaa masiiva elemtentus, bet peedeeja masiiva elementus neizdodas izvadiit! Link to comment Share on other sites More sharing options...
Roze Posted December 9, 2004 Report Share Posted December 9, 2004 Vai nu ir rakstības kļūda vai kā: array('001.gif'','002.gif'') # left-side pic Bet nu tur kaut kā tie apastrofi ir nelabi salikti aiz abiem .gif pa diviem '' Debugam vienmēr der ideālā print_r funkcija <pre><? print_r($GLOBALS['gal']); ?></pre> Link to comment Share on other sites More sharing options...
Venom Posted December 9, 2004 Report Share Posted December 9, 2004 print '<pre>'.print_r($gal,1).'</pre>'; var_dump() arī tā nekas ;) Link to comment Share on other sites More sharing options...
Sandis Posted December 9, 2004 Author Report Share Posted December 9, 2004 Thanks, done! :) Link to comment Share on other sites More sharing options...
bubu Posted December 9, 2004 Report Share Posted December 9, 2004 Tam tachu jaaizskataas shaadi: echo "elements: ". $GLOBALS["gal"][0][4][1]]; echo "elements: ". $GLOBALS["gal"][0][4][2]]; Pirmkārt: tur ir divi ] simboli (tā nevajag). Otrkārt: lai izvadītu 001.gif, lieto: $GLOBALS["gal"][5][0]; lai izvadītu 002.gif, lieto: $GLOBALS["gal"][5][1]; (tik salabo tās pēdiņas, ko Roze minēja). Link to comment Share on other sites More sharing options...
Sandis Posted December 9, 2004 Author Report Share Posted December 9, 2004 Laboshos! :) Bet es tur atkodu shteli - man vajadzeeja no urla panjemtaa galerijas id atnjemt 1 ($_REQUEST["gal"]-1) , jo masiivu saak skaitiit no 0... Link to comment Share on other sites More sharing options...
bubu Posted December 9, 2004 Report Share Posted December 9, 2004 Nu redz, tur jau problēma, tu gribi, lai mēs palīdzam, kad nemaz neesi visu pateicis: kā lai mēs uzminam, kas ir gal? Link to comment Share on other sites More sharing options...
Sandis Posted December 9, 2004 Author Report Share Posted December 9, 2004 Sorry, laboshos! :( Turpmaak pirms jautaashu, sagatavoshu detalizeetu izklaastu! Link to comment Share on other sites More sharing options...
Recommended Posts